{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 读取表格"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>Unnamed: 0.1</th>\n",
       "      <th>sightName</th>\n",
       "      <th>star</th>\n",
       "      <th>score</th>\n",
       "      <th>intro</th>\n",
       "      <th>point</th>\n",
       "      <th>districts</th>\n",
       "      <th>childrenCount</th>\n",
       "      <th>saleCount</th>\n",
       "      <th>qunarPrice</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>豫园</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.2</td>\n",
       "      <td>“奇秀甲于东南”、“东南名园冠”。</td>\n",
       "      <td>121.498981,31.232772</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>820</td>\n",
       "      <td>39.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>上海野生动物园</td>\n",
       "      <td>5A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>与野生动物近距离的“亲密接触”</td>\n",
       "      <td>121.728112,31.059636</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>2667</td>\n",
       "      <td>17.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>上海欢乐谷</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>游乐项目惊险刺激，特色表演异彩纷呈</td>\n",
       "      <td>121.22218,31.102491</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>55</td>\n",
       "      <td>4394</td>\n",
       "      <td>213.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>上海海昌海洋公园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>感受海洋公园乐趣</td>\n",
       "      <td>121.915647,30.917713</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>18</td>\n",
       "      <td>4094</td>\n",
       "      <td>178.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>上海动物园</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>带你领略动物世界的纷繁多彩</td>\n",
       "      <td>121.369411,31.199264</td>\n",
       "      <td>上海·上海·长宁区</td>\n",
       "      <td>0</td>\n",
       "      <td>642</td>\n",
       "      <td>39.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54010</th>\n",
       "      <td>54010</td>\n",
       "      <td>1075</td>\n",
       "      <td>冰情岛达人汇滑雪场</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>驰名中外的冰雪大世界综合滑雪场所</td>\n",
       "      <td>126.571327,45.778679</td>\n",
       "      <td>黑龙江·哈尔滨·松北区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54011</th>\n",
       "      <td>54011</td>\n",
       "      <td>1076</td>\n",
       "      <td>齐齐哈尔奥悦水世界</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>七月盛装开园，水上乐园一枝独秀</td>\n",
       "      <td>123.949088,47.286358</td>\n",
       "      <td>黑龙江·齐齐哈尔·龙沙区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54012</th>\n",
       "      <td>54012</td>\n",
       "      <td>1077</td>\n",
       "      <td>李氏陶艺（中央大街店）</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>集吃、喝、玩、乐于一体的特色DIY工坊</td>\n",
       "      <td>126.626672,45.775049</td>\n",
       "      <td>黑龙江·哈尔滨·道里区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54013</th>\n",
       "      <td>54013</td>\n",
       "      <td>1078</td>\n",
       "      <td>亚布力锅盔山休闲景区</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>古树参天，绿草如茵</td>\n",
       "      <td>128.441239,44.750047</td>\n",
       "      <td>黑龙江·哈尔滨·亚布力新体委滑雪场</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54014</th>\n",
       "      <td>54014</td>\n",
       "      <td>1079</td>\n",
       "      <td>关东古巷</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>哈尔滨时光隧道</td>\n",
       "      <td>126.573464,45.740076</td>\n",
       "      <td>黑龙江·哈尔滨·道里区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>54015 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       Unnamed: 0  Unnamed: 0.1    sightName star  score                intro  \\\n",
       "0               0             0           豫园   4A    4.2    “奇秀甲于东南”、“东南名园冠”。   \n",
       "1               1             1      上海野生动物园   5A    3.6      与野生动物近距离的“亲密接触”   \n",
       "2               2             2        上海欢乐谷   4A    3.6    游乐项目惊险刺激，特色表演异彩纷呈   \n",
       "3               3             3     上海海昌海洋公园    无    0.0             感受海洋公园乐趣   \n",
       "4               4             4        上海动物园   4A    3.6        带你领略动物世界的纷繁多彩   \n",
       "...           ...           ...          ...  ...    ...                  ...   \n",
       "54010       54010          1075    冰情岛达人汇滑雪场    无    0.0     驰名中外的冰雪大世界综合滑雪场所   \n",
       "54011       54011          1076    齐齐哈尔奥悦水世界    无    0.0      七月盛装开园，水上乐园一枝独秀   \n",
       "54012       54012          1077  李氏陶艺（中央大街店）    无    0.0  集吃、喝、玩、乐于一体的特色DIY工坊   \n",
       "54013       54013          1078   亚布力锅盔山休闲景区    无    0.0            古树参天，绿草如茵   \n",
       "54014       54014          1079         关东古巷    无    0.0              哈尔滨时光隧道   \n",
       "\n",
       "                      point          districts  childrenCount  saleCount  \\\n",
       "0      121.498981,31.232772          上海·上海·黄浦区              0        820   \n",
       "1      121.728112,31.059636         上海·上海·浦东新区              0       2667   \n",
       "2       121.22218,31.102491          上海·上海·松江区             55       4394   \n",
       "3      121.915647,30.917713         上海·上海·浦东新区             18       4094   \n",
       "4      121.369411,31.199264          上海·上海·长宁区              0        642   \n",
       "...                     ...                ...            ...        ...   \n",
       "54010  126.571327,45.778679        黑龙江·哈尔滨·松北区              0          0   \n",
       "54011  123.949088,47.286358       黑龙江·齐齐哈尔·龙沙区              0          0   \n",
       "54012  126.626672,45.775049        黑龙江·哈尔滨·道里区              0          0   \n",
       "54013  128.441239,44.750047  黑龙江·哈尔滨·亚布力新体委滑雪场              0          0   \n",
       "54014  126.573464,45.740076        黑龙江·哈尔滨·道里区              0          0   \n",
       "\n",
       "       qunarPrice  \n",
       "0            39.8  \n",
       "1            17.1  \n",
       "2           213.0  \n",
       "3           178.0  \n",
       "4            39.9  \n",
       "...           ...  \n",
       "54010         0.0  \n",
       "54011         0.0  \n",
       "54012         0.0  \n",
       "54013         0.0  \n",
       "54014         0.0  \n",
       "\n",
       "[54015 rows x 11 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv (\"去哪儿2020年五一旅游数据.csv\", encoding = \"utf8\", sep=\",\")\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 数据清洗"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数据清洗一：删除不需要的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sightName</th>\n",
       "      <th>star</th>\n",
       "      <th>score</th>\n",
       "      <th>intro</th>\n",
       "      <th>point</th>\n",
       "      <th>districts</th>\n",
       "      <th>childrenCount</th>\n",
       "      <th>saleCount</th>\n",
       "      <th>qunarPrice</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>豫园</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.2</td>\n",
       "      <td>“奇秀甲于东南”、“东南名园冠”。</td>\n",
       "      <td>121.498981,31.232772</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>820</td>\n",
       "      <td>39.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>上海野生动物园</td>\n",
       "      <td>5A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>与野生动物近距离的“亲密接触”</td>\n",
       "      <td>121.728112,31.059636</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>2667</td>\n",
       "      <td>17.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>上海欢乐谷</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>游乐项目惊险刺激，特色表演异彩纷呈</td>\n",
       "      <td>121.22218,31.102491</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>55</td>\n",
       "      <td>4394</td>\n",
       "      <td>213.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>上海海昌海洋公园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>感受海洋公园乐趣</td>\n",
       "      <td>121.915647,30.917713</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>18</td>\n",
       "      <td>4094</td>\n",
       "      <td>178.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>上海动物园</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>带你领略动物世界的纷繁多彩</td>\n",
       "      <td>121.369411,31.199264</td>\n",
       "      <td>上海·上海·长宁区</td>\n",
       "      <td>0</td>\n",
       "      <td>642</td>\n",
       "      <td>39.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54010</th>\n",
       "      <td>冰情岛达人汇滑雪场</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>驰名中外的冰雪大世界综合滑雪场所</td>\n",
       "      <td>126.571327,45.778679</td>\n",
       "      <td>黑龙江·哈尔滨·松北区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54011</th>\n",
       "      <td>齐齐哈尔奥悦水世界</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>七月盛装开园，水上乐园一枝独秀</td>\n",
       "      <td>123.949088,47.286358</td>\n",
       "      <td>黑龙江·齐齐哈尔·龙沙区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54012</th>\n",
       "      <td>李氏陶艺（中央大街店）</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>集吃、喝、玩、乐于一体的特色DIY工坊</td>\n",
       "      <td>126.626672,45.775049</td>\n",
       "      <td>黑龙江·哈尔滨·道里区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54013</th>\n",
       "      <td>亚布力锅盔山休闲景区</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>古树参天，绿草如茵</td>\n",
       "      <td>128.441239,44.750047</td>\n",
       "      <td>黑龙江·哈尔滨·亚布力新体委滑雪场</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54014</th>\n",
       "      <td>关东古巷</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>哈尔滨时光隧道</td>\n",
       "      <td>126.573464,45.740076</td>\n",
       "      <td>黑龙江·哈尔滨·道里区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>54015 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         sightName star  score                intro                 point  \\\n",
       "0               豫园   4A    4.2    “奇秀甲于东南”、“东南名园冠”。  121.498981,31.232772   \n",
       "1          上海野生动物园   5A    3.6      与野生动物近距离的“亲密接触”  121.728112,31.059636   \n",
       "2            上海欢乐谷   4A    3.6    游乐项目惊险刺激，特色表演异彩纷呈   121.22218,31.102491   \n",
       "3         上海海昌海洋公园    无    0.0             感受海洋公园乐趣  121.915647,30.917713   \n",
       "4            上海动物园   4A    3.6        带你领略动物世界的纷繁多彩  121.369411,31.199264   \n",
       "...            ...  ...    ...                  ...                   ...   \n",
       "54010    冰情岛达人汇滑雪场    无    0.0     驰名中外的冰雪大世界综合滑雪场所  126.571327,45.778679   \n",
       "54011    齐齐哈尔奥悦水世界    无    0.0      七月盛装开园，水上乐园一枝独秀  123.949088,47.286358   \n",
       "54012  李氏陶艺（中央大街店）    无    0.0  集吃、喝、玩、乐于一体的特色DIY工坊  126.626672,45.775049   \n",
       "54013   亚布力锅盔山休闲景区    无    0.0            古树参天，绿草如茵  128.441239,44.750047   \n",
       "54014         关东古巷    无    0.0              哈尔滨时光隧道  126.573464,45.740076   \n",
       "\n",
       "               districts  childrenCount  saleCount  qunarPrice  \n",
       "0              上海·上海·黄浦区              0        820        39.8  \n",
       "1             上海·上海·浦东新区              0       2667        17.1  \n",
       "2              上海·上海·松江区             55       4394       213.0  \n",
       "3             上海·上海·浦东新区             18       4094       178.0  \n",
       "4              上海·上海·长宁区              0        642        39.9  \n",
       "...                  ...            ...        ...         ...  \n",
       "54010        黑龙江·哈尔滨·松北区              0          0         0.0  \n",
       "54011       黑龙江·齐齐哈尔·龙沙区              0          0         0.0  \n",
       "54012        黑龙江·哈尔滨·道里区              0          0         0.0  \n",
       "54013  黑龙江·哈尔滨·亚布力新体委滑雪场              0          0         0.0  \n",
       "54014        黑龙江·哈尔滨·道里区              0          0         0.0  \n",
       "\n",
       "[54015 rows x 9 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df0 = df.drop(['Unnamed: 0','Unnamed: 0.1'],axis=1)\n",
    "df0"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 表格列名重命名"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>豫园</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.2</td>\n",
       "      <td>“奇秀甲于东南”、“东南名园冠”。</td>\n",
       "      <td>121.498981,31.232772</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>820</td>\n",
       "      <td>39.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>上海野生动物园</td>\n",
       "      <td>5A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>与野生动物近距离的“亲密接触”</td>\n",
       "      <td>121.728112,31.059636</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>2667</td>\n",
       "      <td>17.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>上海欢乐谷</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>游乐项目惊险刺激，特色表演异彩纷呈</td>\n",
       "      <td>121.22218,31.102491</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>55</td>\n",
       "      <td>4394</td>\n",
       "      <td>213.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>上海海昌海洋公园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>感受海洋公园乐趣</td>\n",
       "      <td>121.915647,30.917713</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>18</td>\n",
       "      <td>4094</td>\n",
       "      <td>178.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>上海动物园</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>带你领略动物世界的纷繁多彩</td>\n",
       "      <td>121.369411,31.199264</td>\n",
       "      <td>上海·上海·长宁区</td>\n",
       "      <td>0</td>\n",
       "      <td>642</td>\n",
       "      <td>39.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54010</th>\n",
       "      <td>冰情岛达人汇滑雪场</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>驰名中外的冰雪大世界综合滑雪场所</td>\n",
       "      <td>126.571327,45.778679</td>\n",
       "      <td>黑龙江·哈尔滨·松北区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54011</th>\n",
       "      <td>齐齐哈尔奥悦水世界</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>七月盛装开园，水上乐园一枝独秀</td>\n",
       "      <td>123.949088,47.286358</td>\n",
       "      <td>黑龙江·齐齐哈尔·龙沙区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54012</th>\n",
       "      <td>李氏陶艺（中央大街店）</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>集吃、喝、玩、乐于一体的特色DIY工坊</td>\n",
       "      <td>126.626672,45.775049</td>\n",
       "      <td>黑龙江·哈尔滨·道里区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54013</th>\n",
       "      <td>亚布力锅盔山休闲景区</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>古树参天，绿草如茵</td>\n",
       "      <td>128.441239,44.750047</td>\n",
       "      <td>黑龙江·哈尔滨·亚布力新体委滑雪场</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54014</th>\n",
       "      <td>关东古巷</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>哈尔滨时光隧道</td>\n",
       "      <td>126.573464,45.740076</td>\n",
       "      <td>黑龙江·哈尔滨·道里区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>54015 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              景点名称  星级   评分                   介绍                   经纬度  \\\n",
       "0               豫园  4A  4.2    “奇秀甲于东南”、“东南名园冠”。  121.498981,31.232772   \n",
       "1          上海野生动物园  5A  3.6      与野生动物近距离的“亲密接触”  121.728112,31.059636   \n",
       "2            上海欢乐谷  4A  3.6    游乐项目惊险刺激，特色表演异彩纷呈   121.22218,31.102491   \n",
       "3         上海海昌海洋公园   无  0.0             感受海洋公园乐趣  121.915647,30.917713   \n",
       "4            上海动物园  4A  3.6        带你领略动物世界的纷繁多彩  121.369411,31.199264   \n",
       "...            ...  ..  ...                  ...                   ...   \n",
       "54010    冰情岛达人汇滑雪场   无  0.0     驰名中外的冰雪大世界综合滑雪场所  126.571327,45.778679   \n",
       "54011    齐齐哈尔奥悦水世界   无  0.0      七月盛装开园，水上乐园一枝独秀  123.949088,47.286358   \n",
       "54012  李氏陶艺（中央大街店）   无  0.0  集吃、喝、玩、乐于一体的特色DIY工坊  126.626672,45.775049   \n",
       "54013   亚布力锅盔山休闲景区   无  0.0            古树参天，绿草如茵  128.441239,44.750047   \n",
       "54014         关东古巷   无  0.0              哈尔滨时光隧道  126.573464,45.740076   \n",
       "\n",
       "                    所在地区  儿童旅客量   销售量     门票  \n",
       "0              上海·上海·黄浦区      0   820   39.8  \n",
       "1             上海·上海·浦东新区      0  2667   17.1  \n",
       "2              上海·上海·松江区     55  4394  213.0  \n",
       "3             上海·上海·浦东新区     18  4094  178.0  \n",
       "4              上海·上海·长宁区      0   642   39.9  \n",
       "...                  ...    ...   ...    ...  \n",
       "54010        黑龙江·哈尔滨·松北区      0     0    0.0  \n",
       "54011       黑龙江·齐齐哈尔·龙沙区      0     0    0.0  \n",
       "54012        黑龙江·哈尔滨·道里区      0     0    0.0  \n",
       "54013  黑龙江·哈尔滨·亚布力新体委滑雪场      0     0    0.0  \n",
       "54014        黑龙江·哈尔滨·道里区      0     0    0.0  \n",
       "\n",
       "[54015 rows x 9 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df0.columns = ['景点名称','星级','评分','介绍','经纬度','所在地区','儿童旅客量','销售量','门票']\n",
    "df0"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数据清洗二：删除景点名称 重复值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>豫园</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.2</td>\n",
       "      <td>“奇秀甲于东南”、“东南名园冠”。</td>\n",
       "      <td>121.498981,31.232772</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>820</td>\n",
       "      <td>39.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>上海野生动物园</td>\n",
       "      <td>5A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>与野生动物近距离的“亲密接触”</td>\n",
       "      <td>121.728112,31.059636</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>2667</td>\n",
       "      <td>17.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>上海欢乐谷</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>游乐项目惊险刺激，特色表演异彩纷呈</td>\n",
       "      <td>121.22218,31.102491</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>55</td>\n",
       "      <td>4394</td>\n",
       "      <td>213.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>上海海昌海洋公园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>感受海洋公园乐趣</td>\n",
       "      <td>121.915647,30.917713</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>18</td>\n",
       "      <td>4094</td>\n",
       "      <td>178.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>上海动物园</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>带你领略动物世界的纷繁多彩</td>\n",
       "      <td>121.369411,31.199264</td>\n",
       "      <td>上海·上海·长宁区</td>\n",
       "      <td>0</td>\n",
       "      <td>642</td>\n",
       "      <td>39.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7272</th>\n",
       "      <td>53155</td>\n",
       "      <td>冰情岛达人汇滑雪场</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>驰名中外的冰雪大世界综合滑雪场所</td>\n",
       "      <td>126.571327,45.778679</td>\n",
       "      <td>黑龙江·哈尔滨·松北区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7273</th>\n",
       "      <td>53156</td>\n",
       "      <td>齐齐哈尔奥悦水世界</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>七月盛装开园，水上乐园一枝独秀</td>\n",
       "      <td>123.949088,47.286358</td>\n",
       "      <td>黑龙江·齐齐哈尔·龙沙区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7274</th>\n",
       "      <td>53157</td>\n",
       "      <td>李氏陶艺（中央大街店）</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>集吃、喝、玩、乐于一体的特色DIY工坊</td>\n",
       "      <td>126.626672,45.775049</td>\n",
       "      <td>黑龙江·哈尔滨·道里区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7275</th>\n",
       "      <td>53158</td>\n",
       "      <td>亚布力锅盔山休闲景区</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>古树参天，绿草如茵</td>\n",
       "      <td>128.441239,44.750047</td>\n",
       "      <td>黑龙江·哈尔滨·亚布力新体委滑雪场</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7276</th>\n",
       "      <td>53159</td>\n",
       "      <td>关东古巷</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>哈尔滨时光隧道</td>\n",
       "      <td>126.573464,45.740076</td>\n",
       "      <td>黑龙江·哈尔滨·道里区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>7277 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      index         景点名称  星级   评分                   介绍                   经纬度  \\\n",
       "0         0           豫园  4A  4.2    “奇秀甲于东南”、“东南名园冠”。  121.498981,31.232772   \n",
       "1         1      上海野生动物园  5A  3.6      与野生动物近距离的“亲密接触”  121.728112,31.059636   \n",
       "2         2        上海欢乐谷  4A  3.6    游乐项目惊险刺激，特色表演异彩纷呈   121.22218,31.102491   \n",
       "3         3     上海海昌海洋公园   无  0.0             感受海洋公园乐趣  121.915647,30.917713   \n",
       "4         4        上海动物园  4A  3.6        带你领略动物世界的纷繁多彩  121.369411,31.199264   \n",
       "...     ...          ...  ..  ...                  ...                   ...   \n",
       "7272  53155    冰情岛达人汇滑雪场   无  0.0     驰名中外的冰雪大世界综合滑雪场所  126.571327,45.778679   \n",
       "7273  53156    齐齐哈尔奥悦水世界   无  0.0      七月盛装开园，水上乐园一枝独秀  123.949088,47.286358   \n",
       "7274  53157  李氏陶艺（中央大街店）   无  0.0  集吃、喝、玩、乐于一体的特色DIY工坊  126.626672,45.775049   \n",
       "7275  53158   亚布力锅盔山休闲景区   无  0.0            古树参天，绿草如茵  128.441239,44.750047   \n",
       "7276  53159         关东古巷   无  0.0              哈尔滨时光隧道  126.573464,45.740076   \n",
       "\n",
       "                   所在地区  儿童旅客量   销售量     门票  \n",
       "0             上海·上海·黄浦区      0   820   39.8  \n",
       "1            上海·上海·浦东新区      0  2667   17.1  \n",
       "2             上海·上海·松江区     55  4394  213.0  \n",
       "3            上海·上海·浦东新区     18  4094  178.0  \n",
       "4             上海·上海·长宁区      0   642   39.9  \n",
       "...                 ...    ...   ...    ...  \n",
       "7272        黑龙江·哈尔滨·松北区      0     0    0.0  \n",
       "7273       黑龙江·齐齐哈尔·龙沙区      0     0    0.0  \n",
       "7274        黑龙江·哈尔滨·道里区      0     0    0.0  \n",
       "7275  黑龙江·哈尔滨·亚布力新体委滑雪场      0     0    0.0  \n",
       "7276        黑龙江·哈尔滨·道里区      0     0    0.0  \n",
       "\n",
       "[7277 rows x 10 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1 = df0.drop_duplicates(['景点名称']).reset_index()\n",
    "df1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数据处理：将地区细分为省、市、区"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7277\n",
      "7277\n",
      "7277\n",
      "7277\n"
     ]
    }
   ],
   "source": [
    "district = df1['所在地区'].tolist()\n",
    "地区详情 = [ x.split(\"·\") for x in district] \n",
    "省_list = [i[0] for i in 地区详情]\n",
    "市_list = [i[1] for i in 地区详情]\n",
    "\n",
    "for i in 地区详情:\n",
    "    if len(i) >= 4:\n",
    "        a = i\n",
    "        del a[3]\n",
    "    elif len(i) < 3:\n",
    "        b = i\n",
    "        b.append('NaN')\n",
    "\n",
    "区_list = [i[2] for i in 地区详情]\n",
    "\n",
    "# 检查省、市、区list长度是否一致\n",
    "print(len(地区详情))\n",
    "print(len(省_list))\n",
    "print(len(市_list))\n",
    "print(len(区_list))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "      <th>省</th>\n",
       "      <th>市</th>\n",
       "      <th>区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>豫园</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.2</td>\n",
       "      <td>“奇秀甲于东南”、“东南名园冠”。</td>\n",
       "      <td>121.498981,31.232772</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>820</td>\n",
       "      <td>39.8</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>黄浦区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>上海野生动物园</td>\n",
       "      <td>5A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>与野生动物近距离的“亲密接触”</td>\n",
       "      <td>121.728112,31.059636</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>2667</td>\n",
       "      <td>17.1</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>上海欢乐谷</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>游乐项目惊险刺激，特色表演异彩纷呈</td>\n",
       "      <td>121.22218,31.102491</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>55</td>\n",
       "      <td>4394</td>\n",
       "      <td>213.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>松江区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>上海海昌海洋公园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>感受海洋公园乐趣</td>\n",
       "      <td>121.915647,30.917713</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>18</td>\n",
       "      <td>4094</td>\n",
       "      <td>178.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>上海动物园</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>带你领略动物世界的纷繁多彩</td>\n",
       "      <td>121.369411,31.199264</td>\n",
       "      <td>上海·上海·长宁区</td>\n",
       "      <td>0</td>\n",
       "      <td>642</td>\n",
       "      <td>39.9</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>长宁区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7272</th>\n",
       "      <td>53155</td>\n",
       "      <td>冰情岛达人汇滑雪场</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>驰名中外的冰雪大世界综合滑雪场所</td>\n",
       "      <td>126.571327,45.778679</td>\n",
       "      <td>黑龙江·哈尔滨·松北区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>哈尔滨</td>\n",
       "      <td>松北区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7273</th>\n",
       "      <td>53156</td>\n",
       "      <td>齐齐哈尔奥悦水世界</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>七月盛装开园，水上乐园一枝独秀</td>\n",
       "      <td>123.949088,47.286358</td>\n",
       "      <td>黑龙江·齐齐哈尔·龙沙区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>齐齐哈尔</td>\n",
       "      <td>龙沙区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7274</th>\n",
       "      <td>53157</td>\n",
       "      <td>李氏陶艺（中央大街店）</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>集吃、喝、玩、乐于一体的特色DIY工坊</td>\n",
       "      <td>126.626672,45.775049</td>\n",
       "      <td>黑龙江·哈尔滨·道里区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>哈尔滨</td>\n",
       "      <td>道里区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7275</th>\n",
       "      <td>53158</td>\n",
       "      <td>亚布力锅盔山休闲景区</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>古树参天，绿草如茵</td>\n",
       "      <td>128.441239,44.750047</td>\n",
       "      <td>黑龙江·哈尔滨·亚布力新体委滑雪场</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>哈尔滨</td>\n",
       "      <td>亚布力新体委滑雪场</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7276</th>\n",
       "      <td>53159</td>\n",
       "      <td>关东古巷</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>哈尔滨时光隧道</td>\n",
       "      <td>126.573464,45.740076</td>\n",
       "      <td>黑龙江·哈尔滨·道里区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>哈尔滨</td>\n",
       "      <td>道里区</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>7277 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      index         景点名称  星级   评分                   介绍                   经纬度  \\\n",
       "0         0           豫园  4A  4.2    “奇秀甲于东南”、“东南名园冠”。  121.498981,31.232772   \n",
       "1         1      上海野生动物园  5A  3.6      与野生动物近距离的“亲密接触”  121.728112,31.059636   \n",
       "2         2        上海欢乐谷  4A  3.6    游乐项目惊险刺激，特色表演异彩纷呈   121.22218,31.102491   \n",
       "3         3     上海海昌海洋公园   无  0.0             感受海洋公园乐趣  121.915647,30.917713   \n",
       "4         4        上海动物园  4A  3.6        带你领略动物世界的纷繁多彩  121.369411,31.199264   \n",
       "...     ...          ...  ..  ...                  ...                   ...   \n",
       "7272  53155    冰情岛达人汇滑雪场   无  0.0     驰名中外的冰雪大世界综合滑雪场所  126.571327,45.778679   \n",
       "7273  53156    齐齐哈尔奥悦水世界   无  0.0      七月盛装开园，水上乐园一枝独秀  123.949088,47.286358   \n",
       "7274  53157  李氏陶艺（中央大街店）   无  0.0  集吃、喝、玩、乐于一体的特色DIY工坊  126.626672,45.775049   \n",
       "7275  53158   亚布力锅盔山休闲景区   无  0.0            古树参天，绿草如茵  128.441239,44.750047   \n",
       "7276  53159         关东古巷   无  0.0              哈尔滨时光隧道  126.573464,45.740076   \n",
       "\n",
       "                   所在地区  儿童旅客量   销售量     门票    省     市          区  \n",
       "0             上海·上海·黄浦区      0   820   39.8   上海    上海        黄浦区  \n",
       "1            上海·上海·浦东新区      0  2667   17.1   上海    上海       浦东新区  \n",
       "2             上海·上海·松江区     55  4394  213.0   上海    上海        松江区  \n",
       "3            上海·上海·浦东新区     18  4094  178.0   上海    上海       浦东新区  \n",
       "4             上海·上海·长宁区      0   642   39.9   上海    上海        长宁区  \n",
       "...                 ...    ...   ...    ...  ...   ...        ...  \n",
       "7272        黑龙江·哈尔滨·松北区      0     0    0.0  黑龙江   哈尔滨        松北区  \n",
       "7273       黑龙江·齐齐哈尔·龙沙区      0     0    0.0  黑龙江  齐齐哈尔        龙沙区  \n",
       "7274        黑龙江·哈尔滨·道里区      0     0    0.0  黑龙江   哈尔滨        道里区  \n",
       "7275  黑龙江·哈尔滨·亚布力新体委滑雪场      0     0    0.0  黑龙江   哈尔滨  亚布力新体委滑雪场  \n",
       "7276        黑龙江·哈尔滨·道里区      0     0    0.0  黑龙江   哈尔滨        道里区  \n",
       "\n",
       "[7277 rows x 13 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 将处理好的省、市、区数据添加进表格里\n",
    "df1['省'],df1['市'],df1['区'] = [省_list,市_list,区_list]\n",
    "df_new = df1\n",
    "df_new"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 查看表格数据类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "index      int64\n",
       "景点名称      object\n",
       "星级        object\n",
       "评分       float64\n",
       "介绍        object\n",
       "经纬度       object\n",
       "所在地区      object\n",
       "儿童旅客量      int64\n",
       "销售量        int64\n",
       "门票       float64\n",
       "省         object\n",
       "市         object\n",
       "区         object\n",
       "dtype: object"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_new.dtypes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 筛选符合要求的数据"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 将表格里星级、省、市、区数据的unique值分别取出来作为列表  \n",
    ">以便观察，后期为数据分类（区间、类型等）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['4A', '无', '5A', '3A']"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "星级 = pd.unique(df_new['星级'])\n",
    "star_list =list(set(星级))\n",
    "star_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['黑龙江',\n",
       " '安徽',\n",
       " '辽宁',\n",
       " '北京',\n",
       " '山东',\n",
       " '广西',\n",
       " '宁夏',\n",
       " '福建',\n",
       " '内蒙古',\n",
       " '陕西',\n",
       " '天津',\n",
       " '浙江',\n",
       " '甘肃',\n",
       " '湖南',\n",
       " '江苏',\n",
       " '湖北',\n",
       " '海南',\n",
       " '河南',\n",
       " '云南',\n",
       " '吉林',\n",
       " '青海',\n",
       " '香港',\n",
       " '广东',\n",
       " '江西',\n",
       " '上海',\n",
       " '新疆',\n",
       " '贵州',\n",
       " '四川',\n",
       " '澳门',\n",
       " '河北',\n",
       " '重庆',\n",
       " '西藏',\n",
       " '山西',\n",
       " '台湾']"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "省 = pd.unique(df_new['省'])\n",
    "province_list =list(set(省))\n",
    "province_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['白城',\n",
       " '平凉',\n",
       " '浙江',\n",
       " '昌吉',\n",
       " '黔西南',\n",
       " '内江',\n",
       " '滨州',\n",
       " '衡阳',\n",
       " '甘孜州',\n",
       " '石嘴山',\n",
       " '温州',\n",
       " '遵义',\n",
       " '庆阳',\n",
       " '海东地区',\n",
       " '郴州',\n",
       " '肇庆',\n",
       " '朔州',\n",
       " '四川',\n",
       " '呼和浩特',\n",
       " '陵水',\n",
       " '荆州',\n",
       " '白山',\n",
       " '临高',\n",
       " '岳阳',\n",
       " '新竹',\n",
       " '邵阳',\n",
       " '克拉玛依',\n",
       " '营口',\n",
       " '钦州',\n",
       " '冷水江',\n",
       " '那曲',\n",
       " '娄底',\n",
       " '昆明',\n",
       " '西双版纳',\n",
       " '邯郸',\n",
       " '昌都',\n",
       " '丽江',\n",
       " '南昌',\n",
       " '迪庆',\n",
       " '铜仁',\n",
       " '南投',\n",
       " '九江',\n",
       " '嘉峪关',\n",
       " '延边',\n",
       " '湘潭',\n",
       " '台东',\n",
       " '大理',\n",
       " '濮阳',\n",
       " '乌鲁木齐',\n",
       " '无锡',\n",
       " '成都',\n",
       " '陇南',\n",
       " '武汉',\n",
       " '鹤岗',\n",
       " '嘉兴',\n",
       " '红河',\n",
       " '鄂州',\n",
       " '拉萨',\n",
       " '巴音郭楞',\n",
       " '宿迁',\n",
       " '抚州',\n",
       " '苏州',\n",
       " '丹东',\n",
       " '广元',\n",
       " '株洲',\n",
       " '澳门',\n",
       " '铁岭',\n",
       " '宝鸡',\n",
       " '孝感',\n",
       " '漳州',\n",
       " '三亚',\n",
       " '黄山',\n",
       " '柳州',\n",
       " '海南藏族自治州',\n",
       " '张家界',\n",
       " '福州',\n",
       " '济宁',\n",
       " '赤峰',\n",
       " '新乡',\n",
       " '定安',\n",
       " '大兴安岭',\n",
       " '伊春',\n",
       " '德州',\n",
       " '湛江',\n",
       " '安顺',\n",
       " '黔南',\n",
       " '商丘',\n",
       " '台州',\n",
       " '贵阳',\n",
       " '彰化',\n",
       " '连云港',\n",
       " '驻马店',\n",
       " '咸阳',\n",
       " '百色',\n",
       " '贺州',\n",
       " '雅安',\n",
       " '鸡西',\n",
       " '晋中',\n",
       " '崇左',\n",
       " '泉州',\n",
       " '益阳',\n",
       " '和田',\n",
       " '阿拉尔',\n",
       " '恩施',\n",
       " '承德',\n",
       " '三门峡',\n",
       " '云林',\n",
       " '阿里',\n",
       " '随州',\n",
       " '鹰潭',\n",
       " '桂林',\n",
       " '芜湖',\n",
       " '云浮',\n",
       " '上饶',\n",
       " '泰州',\n",
       " '南京',\n",
       " '三明',\n",
       " '长治',\n",
       " '长春',\n",
       " '鞍山',\n",
       " '固原',\n",
       " '眉山',\n",
       " '宜兰',\n",
       " '怀化',\n",
       " '天津',\n",
       " '吕梁',\n",
       " '赣州',\n",
       " '辽阳',\n",
       " '临汾',\n",
       " '青岛',\n",
       " '玉树藏族自治州',\n",
       " '万宁',\n",
       " '中卫',\n",
       " '咸宁',\n",
       " '毕节',\n",
       " '白银',\n",
       " '珠海',\n",
       " '喀什',\n",
       " '许昌',\n",
       " '凉山州',\n",
       " '黄冈',\n",
       " '重庆',\n",
       " '安康',\n",
       " '商洛',\n",
       " '琼中',\n",
       " '德阳',\n",
       " '扬州',\n",
       " '达州',\n",
       " '景德镇',\n",
       " '阿拉善盟',\n",
       " '黔东南',\n",
       " '铜陵',\n",
       " '朝阳',\n",
       " '林芝',\n",
       " '潮州',\n",
       " '宿州',\n",
       " '东营',\n",
       " '保山',\n",
       " '文山',\n",
       " '宁德',\n",
       " '黑河',\n",
       " '常德',\n",
       " '昌江黎族自治县',\n",
       " '邢台',\n",
       " '南通',\n",
       " '金华',\n",
       " '琼海',\n",
       " '儋州',\n",
       " '南充',\n",
       " '海西蒙古族藏族自治州',\n",
       " '西宁',\n",
       " '来宾',\n",
       " '果洛藏族自治州',\n",
       " '通化',\n",
       " '临夏',\n",
       " '桃园',\n",
       " '清远',\n",
       " '西安',\n",
       " '巴彦淖尔',\n",
       " '塔城地区',\n",
       " '包头',\n",
       " '上海',\n",
       " '乌兰察布',\n",
       " '信阳',\n",
       " '牡丹江',\n",
       " '洛阳',\n",
       " '吉安',\n",
       " '玉溪',\n",
       " '太原',\n",
       " '运城',\n",
       " '普洱',\n",
       " '澎湖列岛',\n",
       " '克孜勒苏',\n",
       " '甘南',\n",
       " '北京',\n",
       " '阳江',\n",
       " '鄂尔多斯',\n",
       " '周口',\n",
       " '呼伦贝尔',\n",
       " '郑州',\n",
       " '海北藏族自治州',\n",
       " '昭通',\n",
       " '渭南',\n",
       " '湖州',\n",
       " '忻州',\n",
       " '吐鲁番',\n",
       " '香港',\n",
       " '哈密',\n",
       " '南宁',\n",
       " '丽水',\n",
       " '张家口',\n",
       " '嘉义',\n",
       " '屏东',\n",
       " '新余',\n",
       " '龙岩',\n",
       " '宣城',\n",
       " '安庆',\n",
       " '楚雄',\n",
       " '临沂',\n",
       " '延安',\n",
       " '神农架',\n",
       " '保亭',\n",
       " '聊城',\n",
       " '安阳',\n",
       " '菏泽',\n",
       " '开封',\n",
       " '大庆',\n",
       " '莆田',\n",
       " '保定',\n",
       " '晋城',\n",
       " '茂名',\n",
       " '南平',\n",
       " '松原',\n",
       " '自贡',\n",
       " '揭阳',\n",
       " '泸州',\n",
       " '遂宁',\n",
       " '防城港',\n",
       " '淡水',\n",
       " '阜新',\n",
       " '大连',\n",
       " '台中',\n",
       " '河源',\n",
       " '枣庄',\n",
       " '永州',\n",
       " '曲靖',\n",
       " '厦门',\n",
       " '绵阳',\n",
       " '汉中',\n",
       " '日照',\n",
       " '巴中',\n",
       " '惠州',\n",
       " '定西',\n",
       " '莱芜',\n",
       " '韶关',\n",
       " '泰安',\n",
       " '淮南',\n",
       " '焦作',\n",
       " '廊坊',\n",
       " '玉林',\n",
       " '张掖',\n",
       " '合肥',\n",
       " '宜春',\n",
       " '东莞',\n",
       " '衡水',\n",
       " '四平',\n",
       " '梅州',\n",
       " '杭州',\n",
       " '济南',\n",
       " '佳木斯',\n",
       " '日喀则',\n",
       " '博尔塔拉',\n",
       " '济源',\n",
       " '本溪',\n",
       " '黄南藏族自治州',\n",
       " '梧州',\n",
       " '亳州',\n",
       " '六安',\n",
       " '阿克苏地区',\n",
       " '中山',\n",
       " '海口',\n",
       " '汕头',\n",
       " '兴安盟',\n",
       " '花莲',\n",
       " '江门',\n",
       " '十堰',\n",
       " '双鸭山',\n",
       " '阳泉',\n",
       " '淄博',\n",
       " '基隆',\n",
       " '盐城',\n",
       " '阿坝藏族羌族自治州',\n",
       " '伊犁',\n",
       " '襄阳',\n",
       " '深圳',\n",
       " '平顶山',\n",
       " '榆林',\n",
       " '鹤壁',\n",
       " '金昌',\n",
       " '黄石',\n",
       " '滁州',\n",
       " '漯河',\n",
       " '唐山',\n",
       " '德宏',\n",
       " '常州',\n",
       " '荆门',\n",
       " '新北',\n",
       " '威海',\n",
       " '沈阳',\n",
       " '萍乡',\n",
       " '镇江',\n",
       " '佛山',\n",
       " '绍兴',\n",
       " '山南',\n",
       " '湖南',\n",
       " '六盘水',\n",
       " '哈尔滨',\n",
       " '舟山',\n",
       " '池州',\n",
       " '南阳',\n",
       " '葫芦岛',\n",
       " '通辽',\n",
       " '武威',\n",
       " '锦州',\n",
       " '秦皇岛',\n",
       " '澄迈',\n",
       " '乌海',\n",
       " '衢州',\n",
       " '五指山',\n",
       " '乐山',\n",
       " '广安',\n",
       " '淮安',\n",
       " '马鞍山',\n",
       " '台南',\n",
       " '石河子',\n",
       " '长沙',\n",
       " '仙桃',\n",
       " '北海',\n",
       " '文昌',\n",
       " '吴忠',\n",
       " '齐齐哈尔',\n",
       " '河池',\n",
       " '台北',\n",
       " '宜昌',\n",
       " '广州',\n",
       " '阜阳',\n",
       " '宁波',\n",
       " '潍坊',\n",
       " '五家渠市',\n",
       " '屯昌',\n",
       " '徐州',\n",
       " '台湾',\n",
       " '烟台',\n",
       " '银川',\n",
       " '克孜勒苏柯尔克孜',\n",
       " '天水',\n",
       " '高雄',\n",
       " '吉林市',\n",
       " '阿勒泰',\n",
       " '宜宾',\n",
       " '酒泉',\n",
       " '盘锦',\n",
       " '苗栗',\n",
       " '石家庄',\n",
       " '绥化',\n",
       " '大同',\n",
       " '湘西',\n",
       " '锡林郭勒盟',\n",
       " '抚顺',\n",
       " '兰州',\n",
       " '沧州',\n",
       " '贵港',\n",
       " '铜川']"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "市 = pd.unique(df_new['市'])\n",
    "city_list =list(set(市))\n",
    "city_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['北海银滩',\n",
       " '抚宁县',\n",
       " '和政',\n",
       " '贡觉县',\n",
       " '灞桥区',\n",
       " '渔人码头',\n",
       " '汉口区',\n",
       " '亚龙湾',\n",
       " '南江县',\n",
       " '陈巴尔虎旗',\n",
       " '上犹县',\n",
       " '沧县',\n",
       " '兴文县',\n",
       " '利通区',\n",
       " '沁水县',\n",
       " '禅城区',\n",
       " '达尔罕旗',\n",
       " '寿县',\n",
       " '朱家尖',\n",
       " '望城县',\n",
       " '康县',\n",
       " '澳门银河度假村',\n",
       " '大足石刻',\n",
       " '沙湾温泉旅游区',\n",
       " '永寿县',\n",
       " '天津老城小梨园',\n",
       " '五女峰',\n",
       " '达坂城区',\n",
       " '黄州区',\n",
       " '西安城墙',\n",
       " '田汉大剧院',\n",
       " '沙河口区',\n",
       " '临海市',\n",
       " '渝水区',\n",
       " '金石滩旅游度假区',\n",
       " '大王岭原始生态旅游景区',\n",
       " '尼木',\n",
       " '磐石市',\n",
       " '金山屯区',\n",
       " '威海市',\n",
       " '木兰围场',\n",
       " '黄河三峡',\n",
       " '花明楼景区',\n",
       " '衡山县',\n",
       " '宁明县',\n",
       " '市南区',\n",
       " '观山湖区',\n",
       " '当雄县',\n",
       " '龙南县',\n",
       " '民乐县',\n",
       " '五台山',\n",
       " '黄崖洞',\n",
       " '纳溪区',\n",
       " '清镇市',\n",
       " '南澳县',\n",
       " '密云县',\n",
       " '古丈县',\n",
       " '青藏高原野生动物园',\n",
       " '湘阴县',\n",
       " '克什克腾旗',\n",
       " '甲砬山种植旅游观光园',\n",
       " '治多县',\n",
       " '万州区',\n",
       " '大洼县',\n",
       " '多伦县',\n",
       " '柏乡县',\n",
       " '石排湾公园',\n",
       " '北碚区',\n",
       " '定襄县',\n",
       " '秭归县',\n",
       " '颍上县',\n",
       " '桥西区',\n",
       " '宝安区',\n",
       " '增城',\n",
       " '安义县',\n",
       " '滕州',\n",
       " '枝江市',\n",
       " '新源县',\n",
       " '钟祥市',\n",
       " '阳曲县',\n",
       " '庐山市',\n",
       " '清城区',\n",
       " '恒春古城',\n",
       " '崆峒区',\n",
       " '双牌县',\n",
       " '沈北新区',\n",
       " '峨眉山市',\n",
       " '西贡',\n",
       " '清水河县',\n",
       " '邗江区',\n",
       " '运河区',\n",
       " '安新县',\n",
       " '东西湖区',\n",
       " '新都区',\n",
       " '会宁县',\n",
       " '元阳县',\n",
       " '海安县',\n",
       " '临湘市',\n",
       " '云岩区',\n",
       " '沙湾县',\n",
       " '叶城县',\n",
       " '兴海县',\n",
       " '凤凰县',\n",
       " '太原九龙国际滑雪场',\n",
       " '大东区',\n",
       " '龙岗区',\n",
       " '乐都县',\n",
       " '商河县',\n",
       " '格兰披治大赛车比赛',\n",
       " '集宁区',\n",
       " '颐和园',\n",
       " '东丽区',\n",
       " '清境农场',\n",
       " '越秀区',\n",
       " '仓山区',\n",
       " '阳城县',\n",
       " '宁蒗县',\n",
       " '惠济区',\n",
       " '武陵区',\n",
       " '白塔区',\n",
       " '小七孔景区',\n",
       " '常德桃花源',\n",
       " '福鼎市',\n",
       " '肃州区',\n",
       " '平远县',\n",
       " '贵定县',\n",
       " '神木县',\n",
       " '芝罘区',\n",
       " '茂南区',\n",
       " '润州区',\n",
       " '芮城县',\n",
       " '腾冲火山热海旅游区',\n",
       " '红旗区',\n",
       " '雁塔区',\n",
       " '浑源县',\n",
       " '苏仙区',\n",
       " '临夏市',\n",
       " '永定县',\n",
       " '东山区',\n",
       " '临泉县',\n",
       " '牟平区',\n",
       " '聊城市',\n",
       " '新界',\n",
       " '连南瑶族',\n",
       " '方城县',\n",
       " '芦溪县',\n",
       " '武夷山',\n",
       " '黔西县',\n",
       " '互助北山国家森林公园',\n",
       " '邓州市',\n",
       " '达孜县',\n",
       " '信宜市',\n",
       " '南山牧场',\n",
       " '富春江',\n",
       " '新和县',\n",
       " '朱家角古镇',\n",
       " '灵川县',\n",
       " 'NaN',\n",
       " '西岭雪山',\n",
       " '新宁县',\n",
       " '陕县',\n",
       " '涠洲岛已下线子景点',\n",
       " '湾里区',\n",
       " '定日县',\n",
       " '宏伟区',\n",
       " '敦煌莫高窟',\n",
       " '长白山',\n",
       " '修文县',\n",
       " '襄城区',\n",
       " '岐山县',\n",
       " '吴中区',\n",
       " '尖沙咀',\n",
       " '宜都市',\n",
       " '弋阳县',\n",
       " '洛江区',\n",
       " '宽城区',\n",
       " '狼牙山',\n",
       " '苏家屯区',\n",
       " '当涂县',\n",
       " '鄂托克旗',\n",
       " '玛曲县',\n",
       " '思茅区',\n",
       " '宝兴县',\n",
       " '龙亭区',\n",
       " '怀来县',\n",
       " '南岳区',\n",
       " '太白县',\n",
       " '南浔区',\n",
       " '凤冈县',\n",
       " '海棠湾万达文化中心',\n",
       " '鼎翔旅游度假区',\n",
       " '五营区',\n",
       " '绩溪县',\n",
       " '分宜县',\n",
       " '江岸区',\n",
       " '德兴市',\n",
       " '磐安县',\n",
       " '栖霞区',\n",
       " '黔江区',\n",
       " '平塘县',\n",
       " '奇台县',\n",
       " '班戈',\n",
       " '托克托县',\n",
       " '嘉峪关市',\n",
       " '明山区',\n",
       " '商城县',\n",
       " '凤台县',\n",
       " '汤旺河区',\n",
       " '中西',\n",
       " '甘泉县',\n",
       " '龙安区',\n",
       " '白帝城',\n",
       " '大厂县',\n",
       " '黄岩区',\n",
       " '弓长岭区',\n",
       " '直贡噶举派寺庙群',\n",
       " '铁东区',\n",
       " '丹凤县',\n",
       " '博湖县',\n",
       " '浉河区',\n",
       " '平房区',\n",
       " '邹平县',\n",
       " '黄楮林自然保护区',\n",
       " '洪山区',\n",
       " '龙文区',\n",
       " '湖口县',\n",
       " '亚布力新体委滑雪场',\n",
       " '垣曲黄河',\n",
       " '寻甸县',\n",
       " '二道江区',\n",
       " '巫山县',\n",
       " '芦芽山',\n",
       " '滨海新区',\n",
       " '印台区',\n",
       " '玉州区',\n",
       " '涿州市',\n",
       " '维扬区',\n",
       " '青山区',\n",
       " '宣化区',\n",
       " '五台县',\n",
       " '浦口区',\n",
       " '铁锋区',\n",
       " '东胜区',\n",
       " '夏县',\n",
       " '利顺德大饭店',\n",
       " '宁皇国际旅游度假区',\n",
       " '什刹海',\n",
       " '乐安县',\n",
       " '汉阳区',\n",
       " '莲峰庙',\n",
       " '晋州',\n",
       " '瓯海区',\n",
       " '五虎岛',\n",
       " '石门县',\n",
       " '随县',\n",
       " '天坛公园',\n",
       " '镇安县',\n",
       " '静海县',\n",
       " '宿州市',\n",
       " '山阳区',\n",
       " '昭苏县',\n",
       " '桐乡市',\n",
       " '商州区',\n",
       " '秀屿区',\n",
       " '太原动物园',\n",
       " '鄞州区',\n",
       " '源城区',\n",
       " '含山县',\n",
       " '荥经县',\n",
       " '张家界大峡谷',\n",
       " '铜仁市',\n",
       " '龙口市',\n",
       " '禹州市',\n",
       " '江孜县',\n",
       " '金门县',\n",
       " '壶关县',\n",
       " '阳山县',\n",
       " '北投区',\n",
       " '南靖县',\n",
       " '油尖旺',\n",
       " '青羊区',\n",
       " '金沙县',\n",
       " '即墨市',\n",
       " '宽甸县',\n",
       " '广饶孙子文化旅游度假区',\n",
       " '青阳县',\n",
       " '鼓楼区',\n",
       " '老城区',\n",
       " '麒麟区',\n",
       " '清水县',\n",
       " '门源',\n",
       " '万仙山',\n",
       " '嵩阳景区',\n",
       " '榆次区',\n",
       " '双龙镇',\n",
       " '舞钢市',\n",
       " '东坡区',\n",
       " '镜泊湖风景区',\n",
       " '黟县',\n",
       " '连山县',\n",
       " '汶川县',\n",
       " '涞源县',\n",
       " '扶风县',\n",
       " '固阳县',\n",
       " '建始县',\n",
       " '大渡口区',\n",
       " '谯城区',\n",
       " '黄水国家森林公园',\n",
       " '九城宫旅游景区',\n",
       " '原山',\n",
       " '吐鲁番市',\n",
       " '乃东县',\n",
       " '黄埔区',\n",
       " '新化县',\n",
       " '钦南区',\n",
       " '莲湖区',\n",
       " '龙海市',\n",
       " '新澳海底世界',\n",
       " '凭祥市',\n",
       " '贵溪',\n",
       " '汪清县',\n",
       " '泾县',\n",
       " '周村区',\n",
       " '招远市',\n",
       " '北流市',\n",
       " '浑南区',\n",
       " '耒阳市',\n",
       " '九曲湾温泉度假村',\n",
       " '鞍山千山',\n",
       " '阿克陶县',\n",
       " '邢台县',\n",
       " '大柴旦',\n",
       " '七仙岭温泉国家森林公园',\n",
       " '陇县',\n",
       " '六合区',\n",
       " '雨花区',\n",
       " '紫竹林',\n",
       " '东安县',\n",
       " '独山子区',\n",
       " '西湖区',\n",
       " '濠江区',\n",
       " '东阳市',\n",
       " '跑马地赛马场',\n",
       " '嵩山',\n",
       " '綦江县',\n",
       " '香港岛',\n",
       " '诸城市',\n",
       " '资溪县',\n",
       " '成华区',\n",
       " '西岗区',\n",
       " '科尔沁右翼中旗',\n",
       " '广德县',\n",
       " '白鹿原影视城',\n",
       " '武陵源区',\n",
       " '海阳市',\n",
       " '冠豸山',\n",
       " '金凤区',\n",
       " '顺平县',\n",
       " '澳门威尼斯人度假村',\n",
       " '吉县',\n",
       " '大埔县',\n",
       " '横县',\n",
       " '天燕旅游区',\n",
       " '英山县',\n",
       " '秀峰区',\n",
       " '锦江乐园',\n",
       " '巩义市',\n",
       " '贺兰山国家森林公园（苏峪口）',\n",
       " '三亚湾',\n",
       " '庞泉沟',\n",
       " '昭阳区',\n",
       " '玛多县',\n",
       " '灵武市',\n",
       " '泾川县',\n",
       " '巽寮湾',\n",
       " '乌当区',\n",
       " '泗水县',\n",
       " '白下区',\n",
       " '临安市',\n",
       " '防川风景区',\n",
       " '剑川县',\n",
       " '崇川区',\n",
       " '安宁区',\n",
       " '雁山区',\n",
       " '泉山区',\n",
       " '泰顺县',\n",
       " '梁平县',\n",
       " '建水县',\n",
       " '英西峰林',\n",
       " '鄂城区',\n",
       " '石柱县',\n",
       " '洪湖市',\n",
       " '名山县',\n",
       " '上虞市',\n",
       " '富锦市',\n",
       " '湾仔',\n",
       " '宣武区',\n",
       " '岳阳楼区',\n",
       " '呈贡区',\n",
       " '琼山区',\n",
       " '九龙坡区',\n",
       " '荔浦县',\n",
       " '内乡县',\n",
       " '紫云县',\n",
       " '宝塔区',\n",
       " '错那县',\n",
       " '平山县',\n",
       " '神农架国际生态旅游区',\n",
       " '寻乌县',\n",
       " '安陆市',\n",
       " '泸定县',\n",
       " '延川县',\n",
       " '忻府区',\n",
       " '阆中市',\n",
       " '凤山县',\n",
       " '富春江小三峡',\n",
       " '泉州市',\n",
       " '东川区',\n",
       " '泰山区',\n",
       " '勐腊县',\n",
       " '称多县',\n",
       " '西固区',\n",
       " '安远县',\n",
       " '华蓥市',\n",
       " '洪雅县',\n",
       " '电白县',\n",
       " '安吉县',\n",
       " '千岛湖水下古城',\n",
       " '福建土楼王（高北土楼）',\n",
       " '新民市',\n",
       " '共和县',\n",
       " '三江县',\n",
       " '乌马河区',\n",
       " '军马场',\n",
       " '杏花村',\n",
       " '元坝区',\n",
       " '北林区',\n",
       " '林芝县',\n",
       " '汉滨区',\n",
       " '四会市',\n",
       " '盐湖区',\n",
       " '武汉东湖风景区',\n",
       " '诸暨市',\n",
       " '五常市',\n",
       " '崇信县',\n",
       " '宣恩',\n",
       " '哈密市',\n",
       " '振兴区',\n",
       " '佛冈县',\n",
       " '蒲江县',\n",
       " '海陵区',\n",
       " '敦煌市',\n",
       " '黄骅市',\n",
       " '巴东县',\n",
       " '溧阳市',\n",
       " '房山世界地质公园',\n",
       " '改则县',\n",
       " '阿坝县',\n",
       " '金州区',\n",
       " '津南区',\n",
       " '梁河县',\n",
       " '阿城区',\n",
       " '武夷山市',\n",
       " '上饶县',\n",
       " '涧西区',\n",
       " '桑日县',\n",
       " '武侯区',\n",
       " '徐水县',\n",
       " '永定区',\n",
       " '崖州区',\n",
       " '汤阴县',\n",
       " '沂南县',\n",
       " '沙县',\n",
       " '日喀则市',\n",
       " '循化县',\n",
       " '崇礼县',\n",
       " '堆龙德庆县',\n",
       " '宜州市',\n",
       " '大通县',\n",
       " '西充',\n",
       " '敖汉旗',\n",
       " '麦积区',\n",
       " '三清山已下线子景点',\n",
       " '延庆县',\n",
       " '宝山区',\n",
       " '八达岭长城',\n",
       " '冷水江市资江旅游度假区',\n",
       " '伊金霍洛旗',\n",
       " '中山区',\n",
       " '包河区',\n",
       " '十里蓝山',\n",
       " '晋宁县',\n",
       " '滁州市',\n",
       " '石岐区',\n",
       " '漓江',\n",
       " '漳河风景区',\n",
       " '姜堰市',\n",
       " '罗平县',\n",
       " '绍兴古城',\n",
       " '保康县',\n",
       " '和田县',\n",
       " '开平市',\n",
       " '丘北县',\n",
       " '麦盖提县',\n",
       " '天目湖旅游度假区',\n",
       " '合作市',\n",
       " '志丹县',\n",
       " '珏山',\n",
       " '洛扎县',\n",
       " '道里区',\n",
       " '石阡县',\n",
       " '林州市',\n",
       " '沿滩',\n",
       " '九台市',\n",
       " '中国雪乡',\n",
       " '日月潭',\n",
       " '鸣沙山月牙泉',\n",
       " '迎江区',\n",
       " '潜山市',\n",
       " '清流县',\n",
       " '宁武县',\n",
       " '大连旅顺潜艇博物馆',\n",
       " '大午温泉度假村',\n",
       " '西夏区',\n",
       " '德夯大峡谷',\n",
       " '管城回族区',\n",
       " '凤阳县',\n",
       " '阜宁县',\n",
       " '解放区',\n",
       " '宁国市',\n",
       " '石景山区',\n",
       " '黄山风景区',\n",
       " '炎陵',\n",
       " '江城区',\n",
       " '明十三陵',\n",
       " '通化县',\n",
       " '回民区',\n",
       " '宜秀区',\n",
       " '宁安市',\n",
       " '念青唐古拉山',\n",
       " '贡嘎县',\n",
       " '青海湖',\n",
       " '统景温泉',\n",
       " '荣成市',\n",
       " '关子岭',\n",
       " '吉阳区',\n",
       " '新北区',\n",
       " '遵化市',\n",
       " '闽清县',\n",
       " '宁远县',\n",
       " '沙坪坝区',\n",
       " '金海湖风景区',\n",
       " '房山区',\n",
       " '徐汇区',\n",
       " '侯马市',\n",
       " '南沙区',\n",
       " '三清山',\n",
       " '龙凤区',\n",
       " '科尔沁左翼后旗',\n",
       " '长清区',\n",
       " '桂山风景区',\n",
       " '江津区',\n",
       " '云龙区',\n",
       " '松阳县',\n",
       " '北仑区',\n",
       " '鸡东县',\n",
       " '太湖县',\n",
       " '泽普县',\n",
       " '武隆天生三桥风景区',\n",
       " '眉县',\n",
       " '九原区',\n",
       " '九龙湖新区',\n",
       " '温宿县',\n",
       " '进贤县',\n",
       " '江北区',\n",
       " '乡宁县',\n",
       " '环翠区',\n",
       " '阅海国家湿地公园',\n",
       " '怪石岭',\n",
       " '玉龙县',\n",
       " '乌鲁木齐县',\n",
       " '休宁县',\n",
       " '阳朔县',\n",
       " '居巢区',\n",
       " '竹山县',\n",
       " '农安县',\n",
       " '大港区',\n",
       " '小金县',\n",
       " '邵武市',\n",
       " '涞水县',\n",
       " '梨树县',\n",
       " '吴江区',\n",
       " '瑞丽市',\n",
       " '腾龙仙苑旅游度假风景区',\n",
       " '前郭县',\n",
       " '陇西县',\n",
       " '曲水县',\n",
       " '满洲里市',\n",
       " '镇赉县',\n",
       " '淇县',\n",
       " '缙云县',\n",
       " '灌云县',\n",
       " '宾县',\n",
       " '开福区',\n",
       " '西双版纳自然保护区',\n",
       " '左权县',\n",
       " '宜良县',\n",
       " '同心县',\n",
       " '九寨沟已下线子景点',\n",
       " '右玉县',\n",
       " '固安县',\n",
       " '塔河县',\n",
       " '嵊泗列岛',\n",
       " '嘉善大云',\n",
       " '云阳县',\n",
       " '赤壁市',\n",
       " '从化市',\n",
       " '平潭县',\n",
       " '涵江区',\n",
       " '辉县市',\n",
       " '流溪河国家森林公园',\n",
       " '石狮市',\n",
       " '景泰县',\n",
       " '秦都区',\n",
       " '乌苏市',\n",
       " '莱城区',\n",
       " '汝阳县',\n",
       " '青山湖区',\n",
       " '留坝县',\n",
       " '湟中县',\n",
       " '巩留县',\n",
       " '五华区',\n",
       " '牡丹区',\n",
       " '绛县',\n",
       " '郓城',\n",
       " '措美县',\n",
       " '根河市',\n",
       " '崇明岛',\n",
       " '门源县',\n",
       " '恩施大峡谷',\n",
       " '成县',\n",
       " '新濠天地',\n",
       " '淳安县',\n",
       " '开封县',\n",
       " '鲤城区',\n",
       " '齐云山',\n",
       " '察哈尔右翼中旗',\n",
       " '埇桥区',\n",
       " '泽州县',\n",
       " '龙华新区',\n",
       " '仙寓山',\n",
       " '千岛湖',\n",
       " '怪潭',\n",
       " '昌都县',\n",
       " '港闸区',\n",
       " '合肥融创文化旅游城',\n",
       " '大丰门风景区',\n",
       " '钟山县',\n",
       " '东钱湖',\n",
       " '南湖生态植物示范园',\n",
       " '天河山（中国爱情山）',\n",
       " '缙云仙都',\n",
       " '靖安县',\n",
       " '海盐县',\n",
       " '分界洲岛旅游区',\n",
       " '康定市',\n",
       " '汇川区',\n",
       " '昂仁县',\n",
       " '龙州县',\n",
       " '镇远',\n",
       " '雷山县',\n",
       " '昌黎县',\n",
       " '忻州凤凰山',\n",
       " '右江区',\n",
       " '宕昌县',\n",
       " '资阳区',\n",
       " '腾冲',\n",
       " '南湖区',\n",
       " '茂县',\n",
       " '韶关丹霞山',\n",
       " '贾汪区',\n",
       " '阿勒泰市',\n",
       " '恩施野三峡综合旅游区',\n",
       " '双流区',\n",
       " '平江区',\n",
       " '萝北县',\n",
       " '大理苍山石门关景区',\n",
       " '清河林业旅游区',\n",
       " '净月潭',\n",
       " '永顺县',\n",
       " '平江县',\n",
       " '连江县',\n",
       " '张家界国家森林公园',\n",
       " '龙顺度假庄园生态观光园',\n",
       " '宁城县',\n",
       " '特克斯县',\n",
       " '布达拉宫',\n",
       " '乌金山国家森林公园',\n",
       " '东湖区',\n",
       " '南召县',\n",
       " '新濠影汇',\n",
       " '中牟县',\n",
       " '柳北区',\n",
       " '西部长青旅游度假区',\n",
       " '西宁市区',\n",
       " '昔阳县',\n",
       " '大余县',\n",
       " '蓟县',\n",
       " '沙市区',\n",
       " '金石滩国家地质公园',\n",
       " '天津龙达温泉生态城',\n",
       " '呼兰河口湿地风景区',\n",
       " '樊城区',\n",
       " '开平碉楼',\n",
       " '大足县',\n",
       " '平安县',\n",
       " '天柱山',\n",
       " '同里古镇',\n",
       " '溆浦县',\n",
       " '德惠市',\n",
       " '库伦旗',\n",
       " '三台县',\n",
       " '盘龙区',\n",
       " '香港迪士尼乐园',\n",
       " '天津盘山风景名胜区',\n",
       " '三门县',\n",
       " '平度市',\n",
       " '池州市',\n",
       " '郭麻日寺',\n",
       " '瓜州县',\n",
       " '洛川县',\n",
       " '于洪区',\n",
       " '金阊区',\n",
       " '亭湖区',\n",
       " '彭州市',\n",
       " '胭脂峡',\n",
       " '土默特右旗',\n",
       " '庆城县',\n",
       " '吴兴区',\n",
       " '临泽县',\n",
       " '安溪县',\n",
       " '巴马县',\n",
       " '射洪县',\n",
       " '青原区',\n",
       " '武进区',\n",
       " '霍山县',\n",
       " '瓦房店市',\n",
       " '花都区',\n",
       " '五峰县',\n",
       " '同安区',\n",
       " '商南县',\n",
       " '晋源区',\n",
       " '天山天池',\n",
       " '乌兰布统旅游区',\n",
       " '乌镇',\n",
       " '都江堰市',\n",
       " '乌拉特后旗',\n",
       " '灵山县',\n",
       " '丽江古城',\n",
       " '西峰区',\n",
       " '同德县',\n",
       " '忠县',\n",
       " '新马路',\n",
       " '扎兰屯市',\n",
       " '平顺县',\n",
       " '江阴市',\n",
       " '酌江风景区',\n",
       " '酉阳县',\n",
       " '户县',\n",
       " '太平山顶',\n",
       " '洋县',\n",
       " '南川区',\n",
       " '乾县',\n",
       " '武义县',\n",
       " '肃南县',\n",
       " '长白南麓',\n",
       " '都江堰',\n",
       " '渝北区',\n",
       " '珲春市',\n",
       " '宜阳县',\n",
       " '东港市',\n",
       " '新华区',\n",
       " '南翔古镇',\n",
       " '色达县',\n",
       " '威海华夏城景区',\n",
       " '高邮市',\n",
       " '汤原县',\n",
       " '湖里区',\n",
       " '海棠区',\n",
       " '绿园区',\n",
       " '凉州区',\n",
       " '来安县',\n",
       " '翔安区',\n",
       " '端州区',\n",
       " '郧阳区',\n",
       " '独山县',\n",
       " '波密县',\n",
       " '和林格尔县',\n",
       " '正宁县',\n",
       " '西工区',\n",
       " '金沙湾景区',\n",
       " '兴城市',\n",
       " '五莲县',\n",
       " '盂县',\n",
       " '路环岛',\n",
       " '冀州市',\n",
       " '渠县',\n",
       " '红花岗区',\n",
       " '宁河县',\n",
       " '天台县',\n",
       " '揭西县',\n",
       " '金牛区',\n",
       " '博斯腾湖',\n",
       " '汨罗市',\n",
       " '辽阳县',\n",
       " '民勤县',\n",
       " '四川卧龙自然保护区',\n",
       " '水濂山',\n",
       " '隆安县',\n",
       " '沙坡头区',\n",
       " '承德县',\n",
       " '乌审旗',\n",
       " '绵山',\n",
       " '锡林浩特市',\n",
       " '师宗县',\n",
       " '华夏文旅西安度假区',\n",
       " '漳州土楼群',\n",
       " '汝州',\n",
       " '香河县',\n",
       " '荔波县',\n",
       " '崇安区',\n",
       " '上党区',\n",
       " '缙云山',\n",
       " '崇明县',\n",
       " '永靖县',\n",
       " '亚东',\n",
       " '梁山县',\n",
       " '喜洲',\n",
       " '余姚市',\n",
       " '东昌区',\n",
       " '关岭县',\n",
       " '韶山市',\n",
       " '卢湾区',\n",
       " '宣汉县',\n",
       " '偏关县',\n",
       " '大屿山',\n",
       " '普陀山风景区',\n",
       " '宁强县',\n",
       " '双龙',\n",
       " '嘉定区',\n",
       " '和顺古镇',\n",
       " '海淀区',\n",
       " '固始县',\n",
       " '南谯区',\n",
       " '大安区',\n",
       " '宁乡县',\n",
       " '香纸沟',\n",
       " '临洮县',\n",
       " '山亭区',\n",
       " '武宁县',\n",
       " '张家港市',\n",
       " '公主岭市',\n",
       " '朝天区',\n",
       " '伊宁市',\n",
       " '奉新县',\n",
       " '常宁',\n",
       " '南安市',\n",
       " '沙依巴克区',\n",
       " '吉木萨尔县',\n",
       " '榆阳区',\n",
       " '宛城区',\n",
       " '五指山热带雨林风景区',\n",
       " '江阳区',\n",
       " '城关区',\n",
       " '城中区',\n",
       " '通山县',\n",
       " '同仁县',\n",
       " '桐梓县',\n",
       " '上海马陆葡萄艺术村',\n",
       " '八公山区',\n",
       " '湄洲岛',\n",
       " '万盛区',\n",
       " '市中区',\n",
       " '余杭区',\n",
       " '旅顺口区',\n",
       " '乌兰县',\n",
       " '西乡县',\n",
       " '老虎滩海洋公园',\n",
       " '五大道',\n",
       " '金台区',\n",
       " '鲅鱼圈区',\n",
       " '乌兰浩特市',\n",
       " '安阳县',\n",
       " '沕沕水',\n",
       " '犍为县',\n",
       " '绥芬河市',\n",
       " '海珠区',\n",
       " '平坝县',\n",
       " '镇原县',\n",
       " '北辰区',\n",
       " '澜沧江',\n",
       " '广安区',\n",
       " '慕田峪长城',\n",
       " '邯郸县',\n",
       " '建德市',\n",
       " '雁荡山',\n",
       " '永登县',\n",
       " '澳门旅游观光塔',\n",
       " '石城县',\n",
       " '卡定沟',\n",
       " '祁门县',\n",
       " '岳普湖县',\n",
       " '叠彩伏波景区',\n",
       " '鲁山县',\n",
       " '扶绥县',\n",
       " '仪征市',\n",
       " '台北车站',\n",
       " '秀峰',\n",
       " '郊区',\n",
       " '华亭县',\n",
       " '北京动物园',\n",
       " '仙岛湖',\n",
       " '南开区',\n",
       " '枞阳县',\n",
       " '乌什县',\n",
       " '临城县',\n",
       " '蛟河市',\n",
       " '铁力市',\n",
       " '溪口风景区',\n",
       " '靖宇县',\n",
       " '盘县',\n",
       " '蒲台群岛',\n",
       " '巴楚县',\n",
       " '薛城区',\n",
       " '武安市',\n",
       " '久治县',\n",
       " '祥云县',\n",
       " '浪卡子',\n",
       " '仙居',\n",
       " '图们市',\n",
       " '和龙市',\n",
       " '合川区',\n",
       " '昆嵛山国家森林公园',\n",
       " '武隆仙女山国家森林公园',\n",
       " '丰都县',\n",
       " '新津县',\n",
       " '浑江区',\n",
       " '富阳市',\n",
       " '南丫岛',\n",
       " '三爪仑',\n",
       " '舒兰市',\n",
       " '扎囊县',\n",
       " '阿拉善左旗',\n",
       " '丰顺县',\n",
       " '平遥县',\n",
       " '奉节县',\n",
       " '巩乃斯森林公园',\n",
       " '九华山',\n",
       " '历城区',\n",
       " '文登市',\n",
       " '确山县',\n",
       " '云和县',\n",
       " '屯溪区',\n",
       " '柞水县',\n",
       " '齐河县',\n",
       " '景洪曼听公园',\n",
       " '天心区',\n",
       " '滦县',\n",
       " '玉山县',\n",
       " '饶平县',\n",
       " '玉渡山',\n",
       " '英德市',\n",
       " '丰宁县',\n",
       " '塔尔寺',\n",
       " '兴庆区',\n",
       " '萧县',\n",
       " '施秉县',\n",
       " '八宿县',\n",
       " '武平县',\n",
       " '观澜山水田园旅游文化园',\n",
       " '铅山县',\n",
       " '松鸣岩',\n",
       " '迭部县',\n",
       " '南芬区',\n",
       " '普兰县',\n",
       " '原州区',\n",
       " '杨浦区',\n",
       " '昌江区',\n",
       " '额敏县',\n",
       " '富蕴县',\n",
       " '崂山区',\n",
       " '侗乡鸟巢',\n",
       " '凤城市',\n",
       " '南郑县',\n",
       " '通河县',\n",
       " '和平区',\n",
       " '博爱县',\n",
       " '墨玉县',\n",
       " '祁连县',\n",
       " '昭平县',\n",
       " ...]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "区 = pd.unique(df_new['区'])\n",
    "district_list =list(set(区))\n",
    "district_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0.5,\n",
       " 1.0,\n",
       " 2.0,\n",
       " 1.5,\n",
       " 0.0,\n",
       " 4.0,\n",
       " 3.0,\n",
       " 7.0,\n",
       " 8.0,\n",
       " 9.0,\n",
       " 10.0,\n",
       " 5.0,\n",
       " 12.0,\n",
       " 13.0,\n",
       " 12.8,\n",
       " 15.0,\n",
       " 14.0,\n",
       " 17.1,\n",
       " 17.0,\n",
       " 18.0,\n",
       " 20.0,\n",
       " 19.9,\n",
       " 22.0,\n",
       " 23.9,\n",
       " 22.5,\n",
       " 25.0,\n",
       " 26.0,\n",
       " 27.8,\n",
       " 28.0,\n",
       " 29.0,\n",
       " 30.0,\n",
       " 29.9,\n",
       " 23.0,\n",
       " 33.0,\n",
       " 34.0,\n",
       " 35.0,\n",
       " 36.0,\n",
       " 37.9,\n",
       " 38.0,\n",
       " 39.9,\n",
       " 39.8,\n",
       " 39.0,\n",
       " 40.0,\n",
       " 34.5,\n",
       " 44.0,\n",
       " 45.0,\n",
       " 46.0,\n",
       " 41.5,\n",
       " 48.0,\n",
       " 49.0,\n",
       " 49.9,\n",
       " 50.0,\n",
       " 49.8,\n",
       " 53.0,\n",
       " 54.8,\n",
       " 55.0,\n",
       " 56.0,\n",
       " 57.9,\n",
       " 58.0,\n",
       " 59.8,\n",
       " 60.0,\n",
       " 57.0,\n",
       " 62.0,\n",
       " 63.0,\n",
       " 55.5,\n",
       " 65.0,\n",
       " 66.6,\n",
       " 66.3,\n",
       " 68.0,\n",
       " 67.9,\n",
       " 70.8,\n",
       " 70.0,\n",
       " 66.0,\n",
       " 73.0,\n",
       " 74.0,\n",
       " 75.0,\n",
       " 67.0,\n",
       " 69.5,\n",
       " 78.0,\n",
       " 79.0,\n",
       " 80.0,\n",
       " 16.0,\n",
       " 82.2,\n",
       " 74.5,\n",
       " 76.0,\n",
       " 85.0,\n",
       " 86.0,\n",
       " 78.9,\n",
       " 88.0,\n",
       " 89.9,\n",
       " 90.0,\n",
       " 89.0,\n",
       " 92.0,\n",
       " 87.8,\n",
       " 94.5,\n",
       " 95.0,\n",
       " 19.0,\n",
       " 97.0,\n",
       " 98.0,\n",
       " 99.0,\n",
       " 100.0,\n",
       " 99.8,\n",
       " 96.0,\n",
       " 102.0,\n",
       " 20.5,\n",
       " 105.0,\n",
       " 106.0,\n",
       " 107.0,\n",
       " 108.0,\n",
       " 109.0,\n",
       " 110.0,\n",
       " 109.9,\n",
       " 112.0,\n",
       " 113.0,\n",
       " 114.0,\n",
       " 113.5,\n",
       " 116.0,\n",
       " 115.9,\n",
       " 118.0,\n",
       " 115.0,\n",
       " 120.0,\n",
       " 24.0,\n",
       " 24.5,\n",
       " 122.0,\n",
       " 123.8,\n",
       " 125.0,\n",
       " 123.0,\n",
       " 127.7,\n",
       " 128.0,\n",
       " 129.6,\n",
       " 129.0,\n",
       " 130.0,\n",
       " 132.0,\n",
       " 26.5,\n",
       " 134.5,\n",
       " 135.0,\n",
       " 27.5,\n",
       " 27.0,\n",
       " 138.0,\n",
       " 139.0,\n",
       " 140.0,\n",
       " 137.0,\n",
       " 136.0,\n",
       " 134.0,\n",
       " 28.5,\n",
       " 145.0,\n",
       " 146.0,\n",
       " 147.0,\n",
       " 148.0,\n",
       " 149.0,\n",
       " 150.0,\n",
       " 151.6,\n",
       " 152.0,\n",
       " 155.0,\n",
       " 31.5,\n",
       " 157.0,\n",
       " 158.0,\n",
       " 159.0,\n",
       " 160.0,\n",
       " 31.0,\n",
       " 32.0,\n",
       " 32.5,\n",
       " 162.0,\n",
       " 165.0,\n",
       " 166.0,\n",
       " 163.0,\n",
       " 168.0,\n",
       " 169.0,\n",
       " 170.0,\n",
       " 33.5,\n",
       " 167.0,\n",
       " 172.0,\n",
       " 174.0,\n",
       " 175.0,\n",
       " 35.5,\n",
       " 178.0,\n",
       " 179.0,\n",
       " 180.0,\n",
       " 179.8,\n",
       " 36.5,\n",
       " 7.5,\n",
       " 184.0,\n",
       " 185.0,\n",
       " 186.0,\n",
       " 37.0,\n",
       " 188.0,\n",
       " 37.5,\n",
       " 190.0,\n",
       " 187.0,\n",
       " 192.0,\n",
       " 193.0,\n",
       " 189.0,\n",
       " 195.0,\n",
       " 38.5,\n",
       " 197.0,\n",
       " 198.0,\n",
       " 199.0,\n",
       " 200.0,\n",
       " 198.99,\n",
       " 40.5,\n",
       " 194.0,\n",
       " 39.5,\n",
       " 205.0,\n",
       " 41.0,\n",
       " 208.0,\n",
       " 208.65,\n",
       " 210.0,\n",
       " 42.0,\n",
       " 213.0,\n",
       " 214.0,\n",
       " 215.0,\n",
       " 216.0,\n",
       " 43.0,\n",
       " 218.0,\n",
       " 219.8,\n",
       " 220.0,\n",
       " 221.0,\n",
       " 44.5,\n",
       " 43.5,\n",
       " 217.0,\n",
       " 227.0,\n",
       " 228.0,\n",
       " 45.5,\n",
       " 230.0,\n",
       " 9.5,\n",
       " 46.5,\n",
       " 231.1,\n",
       " 234.0,\n",
       " 235.0,\n",
       " 236.0,\n",
       " 47.0,\n",
       " 238.0,\n",
       " 47.5,\n",
       " 240.0,\n",
       " 239.0,\n",
       " 48.5,\n",
       " 245.0,\n",
       " 248.0,\n",
       " 249.0,\n",
       " 250.0,\n",
       " 254.0,\n",
       " 255.0,\n",
       " 51.0,\n",
       " 258.0,\n",
       " 259.0,\n",
       " 260.0,\n",
       " 262.0,\n",
       " 52.0,\n",
       " 265.0,\n",
       " 267.0,\n",
       " 268.0,\n",
       " 269.0,\n",
       " 54.0,\n",
       " 54.5,\n",
       " 275.0,\n",
       " 278.0,\n",
       " 280.0,\n",
       " 2.5,\n",
       " 11.0,\n",
       " 282.0,\n",
       " 284.0,\n",
       " 285.0,\n",
       " 286.0,\n",
       " 288.0,\n",
       " 290.0,\n",
       " 292.0,\n",
       " 296.0,\n",
       " 297.0,\n",
       " 298.0,\n",
       " 59.0,\n",
       " 300.0,\n",
       " 299.0,\n",
       " 59.5,\n",
       " 4399.0,\n",
       " 12.5,\n",
       " 61.0,\n",
       " 308.0,\n",
       " 318.0,\n",
       " 64.0,\n",
       " 64.5,\n",
       " 64.9,\n",
       " 328.0,\n",
       " 65.1,\n",
       " 330.0,\n",
       " 13.5,\n",
       " 65.9,\n",
       " 66.5,\n",
       " 329.0,\n",
       " 336.0,\n",
       " 67.5,\n",
       " 338.0,\n",
       " 340.0,\n",
       " 69.0,\n",
       " 349.0,\n",
       " 69.9,\n",
       " 2399.0,\n",
       " 350.0,\n",
       " 70.9,\n",
       " 2403.0,\n",
       " 14.5,\n",
       " 358.0,\n",
       " 71.0,\n",
       " 360.0,\n",
       " 72.0,\n",
       " 72.5,\n",
       " 366.0,\n",
       " 368.0,\n",
       " 369.0,\n",
       " 377.0,\n",
       " 378.0,\n",
       " 75.5,\n",
       " 380.0,\n",
       " 15.5,\n",
       " 76.5,\n",
       " 0.3,\n",
       " 385.0,\n",
       " 388.0,\n",
       " 77.0,\n",
       " 77.5,\n",
       " 77.9,\n",
       " 27.91,\n",
       " 78.5,\n",
       " 78.6,\n",
       " 398.0,\n",
       " 399.0,\n",
       " 400.0,\n",
       " 79.9,\n",
       " 403.0,\n",
       " 408.0,\n",
       " 81.0,\n",
       " 5.1,\n",
       " 409.0,\n",
       " 82.0,\n",
       " 416.0,\n",
       " 83.5,\n",
       " 83.0,\n",
       " 420.0,\n",
       " 2470.0,\n",
       " 84.0,\n",
       " 84.9,\n",
       " 428.0,\n",
       " 429.0,\n",
       " 436.0,\n",
       " 87.0,\n",
       " 87.78,\n",
       " 88.5,\n",
       " 450.0,\n",
       " 2499.0,\n",
       " 452.0,\n",
       " 90.5,\n",
       " 455.0,\n",
       " 18.5,\n",
       " 6600.0,\n",
       " 458.0,\n",
       " 91.0,\n",
       " 15.6,\n",
       " 459.0,\n",
       " 14.6,\n",
       " 92.5,\n",
       " 93.0,\n",
       " 468.0,\n",
       " 93.5,\n",
       " 93.9,\n",
       " 94.0,\n",
       " 95.5,\n",
       " 478.0,\n",
       " 480.0,\n",
       " 19.5,\n",
       " 96.5,\n",
       " 488.0,\n",
       " 98.5,\n",
       " 498.0,\n",
       " 499.0,\n",
       " 500.0,\n",
       " 0.8,\n",
       " 1.8,\n",
       " 1.3,\n",
       " 103.0,\n",
       " 520.0,\n",
       " 519.0,\n",
       " 104.0,\n",
       " 104.5,\n",
       " 21.0,\n",
       " 540.0,\n",
       " 548.0,\n",
       " 550.0,\n",
       " 552.0,\n",
       " 558.0,\n",
       " 111.0,\n",
       " 560.0,\n",
       " 566.0,\n",
       " 568.0,\n",
       " 114.5,\n",
       " 0.79,\n",
       " 580.0,\n",
       " 23.5,\n",
       " 588.0,\n",
       " 117.0,\n",
       " 117.6,\n",
       " 598.0,\n",
       " 119.0,\n",
       " 600.0,\n",
       " 18.6,\n",
       " 19.6,\n",
       " 615.0,\n",
       " 618.0,\n",
       " 124.0,\n",
       " 23.1,\n",
       " 630.0,\n",
       " 2680.0,\n",
       " 126.0,\n",
       " 127.0,\n",
       " 26.6,\n",
       " 128.9,\n",
       " 646.0,\n",
       " 129.5,\n",
       " 2.76,\n",
       " 650.0,\n",
       " 655.0,\n",
       " 29.6,\n",
       " 31.1,\n",
       " 31.6,\n",
       " 133.0,\n",
       " 134.6,\n",
       " 33.6,\n",
       " 680.0,\n",
       " 33.01,\n",
       " 34.1,\n",
       " 688.0,\n",
       " 690.0,\n",
       " 137.8,\n",
       " 700.0,\n",
       " 39.6,\n",
       " 715.0,\n",
       " 42.6,\n",
       " 44.1,\n",
       " 44.6,\n",
       " 45.6,\n",
       " 750.0,\n",
       " 48.1,\n",
       " 49.6,\n",
       " 760.0,\n",
       " 0.6,\n",
       " 0.85,\n",
       " 0.89,\n",
       " 53.6,\n",
       " 6.0,\n",
       " 156.0,\n",
       " 788.0,\n",
       " 799.0,\n",
       " 800.0,\n",
       " 58.6,\n",
       " 10.2,\n",
       " 830.0,\n",
       " 2880.0,\n",
       " 0.1,\n",
       " 835.6,\n",
       " 838.0,\n",
       " 2.7,\n",
       " 3.2,\n",
       " 875.0,\n",
       " 899.0,\n",
       " 26.2,\n",
       " 182.0,\n",
       " 30.2,\n",
       " 2988.0,\n",
       " 950.0,\n",
       " 2999.0,\n",
       " 191.0,\n",
       " 988.0,\n",
       " 999.0,\n",
       " 1.9,\n",
       " 1.4,\n",
       " 1.1,\n",
       " 2.9,\n",
       " 1.6,\n",
       " 3.9,\n",
       " 2.4,\n",
       " 3.6,\n",
       " 212.0,\n",
       " 1088.0,\n",
       " 1100.0,\n",
       " 33.8,\n",
       " 34.8,\n",
       " 1199.0,\n",
       " 1200.0,\n",
       " 35.8,\n",
       " 36.8,\n",
       " 36.7,\n",
       " 37.8,\n",
       " 38.8,\n",
       " 38.7,\n",
       " 40.8,\n",
       " 2.8,\n",
       " 41.8,\n",
       " 3280.0,\n",
       " 42.8,\n",
       " 4.8,\n",
       " 4.3,\n",
       " 44.8,\n",
       " 6.3,\n",
       " 44.2,\n",
       " 1250.0,\n",
       " 45.7,\n",
       " 7.8,\n",
       " 45.8,\n",
       " 46.3,\n",
       " 48.3,\n",
       " 48.8,\n",
       " 49.7,\n",
       " 50.3,\n",
       " 0.9,\n",
       " 0.4,\n",
       " 1280.0,\n",
       " 56.7,\n",
       " 58.8,\n",
       " 8.8,\n",
       " 62.2,\n",
       " 63.3,\n",
       " 13.8,\n",
       " 64.8,\n",
       " 64.7,\n",
       " 14.8,\n",
       " 15.8,\n",
       " 16.8,\n",
       " 17.3,\n",
       " 17.8,\n",
       " 69.8,\n",
       " 19.8,\n",
       " 71.8,\n",
       " 72.8,\n",
       " 74.8,\n",
       " 1398.0,\n",
       " 75.3,\n",
       " 25.8,\n",
       " 26.8,\n",
       " 28.8,\n",
       " 79.8,\n",
       " 29.8,\n",
       " 30.8,\n",
       " 31.8,\n",
       " 1460.0,\n",
       " 89.7,\n",
       " 1488.0,\n",
       " 95.8,\n",
       " 98.3,\n",
       " 98.7,\n",
       " 98.8,\n",
       " 0.7,\n",
       " 1.2,\n",
       " 0.49,\n",
       " 1.7,\n",
       " 0.99,\n",
       " 108.8,\n",
       " 109.8,\n",
       " 10.96,\n",
       " 5688.0,\n",
       " 1600.0,\n",
       " 16.9,\n",
       " 17.9,\n",
       " 18.9,\n",
       " 18.4,\n",
       " 24.9,\n",
       " 25.4,\n",
       " 25.9,\n",
       " 1666.0,\n",
       " 26.9,\n",
       " 27.9,\n",
       " 28.9,\n",
       " 29.4,\n",
       " 30.9,\n",
       " 1688.0,\n",
       " 31.9,\n",
       " 1699.0,\n",
       " 34.9,\n",
       " 9.9,\n",
       " 35.9,\n",
       " 11.9,\n",
       " 12.9,\n",
       " 38.9,\n",
       " 13.9,\n",
       " 15.9,\n",
       " 41.9,\n",
       " 42.9,\n",
       " 43.9,\n",
       " 44.9,\n",
       " 46.9,\n",
       " 48.9,\n",
       " 51.4,\n",
       " 52.4,\n",
       " 1799.0,\n",
       " 52.9,\n",
       " 54.9,\n",
       " 54.4,\n",
       " 56.9,\n",
       " 58.9,\n",
       " 59.9,\n",
       " 62.9,\n",
       " 1850.0,\n",
       " 5999.0,\n",
       " 1980.0,\n",
       " 1999.0,\n",
       " 2000.0]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "门票 = pd.unique(df_new['门票'])\n",
    "price_list =list(set(门票))\n",
    "price_list"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 封装函数：根据不同指标查找景点\n",
    "星级、省、市、区"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "def star(i):\n",
    "    \"\"\"\n",
    "    star是用于根据星级条件查找相关景点的函数；\n",
    "    其中参数i 只能输入 字符串：\n",
    "            '3A', '无', '5A', '4A'\n",
    "    \"\"\"\n",
    "    星级 = pd.unique(df_new['星级'])\n",
    "    star_list =list(set(星级))\n",
    "    if i in star_list:\n",
    "        star_choose=df_new[df_new['星级'].isin([i])]\n",
    "        return star_choose"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "      <th>省</th>\n",
       "      <th>市</th>\n",
       "      <th>区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>豫园</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.2</td>\n",
       "      <td>“奇秀甲于东南”、“东南名园冠”。</td>\n",
       "      <td>121.498981,31.232772</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>820</td>\n",
       "      <td>39.8</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>黄浦区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>上海欢乐谷</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>游乐项目惊险刺激，特色表演异彩纷呈</td>\n",
       "      <td>121.22218,31.102491</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>55</td>\n",
       "      <td>4394</td>\n",
       "      <td>213.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>松江区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>上海动物园</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>带你领略动物世界的纷繁多彩</td>\n",
       "      <td>121.369411,31.199264</td>\n",
       "      <td>上海·上海·长宁区</td>\n",
       "      <td>0</td>\n",
       "      <td>642</td>\n",
       "      <td>39.9</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>长宁区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>6</td>\n",
       "      <td>东方绿舟</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.5</td>\n",
       "      <td>全国首屈一指的青少年校外教育营地</td>\n",
       "      <td>121.015977,31.107866</td>\n",
       "      <td>上海·上海·青浦区</td>\n",
       "      <td>4</td>\n",
       "      <td>384</td>\n",
       "      <td>44.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>青浦区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>7</td>\n",
       "      <td>上海影视乐园</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.5</td>\n",
       "      <td>真实艺术地展现上海的历史风貌和人文景观</td>\n",
       "      <td>121.319396,31.016693</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>0</td>\n",
       "      <td>348</td>\n",
       "      <td>48.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>松江区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7171</th>\n",
       "      <td>53042</td>\n",
       "      <td>哈尔滨建筑艺术馆</td>\n",
       "      <td>4A</td>\n",
       "      <td>0.0</td>\n",
       "      <td>凝聚着音乐的优美旋律与建筑智慧之光</td>\n",
       "      <td>126.633625,45.776471</td>\n",
       "      <td>黑龙江·哈尔滨·道里区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>哈尔滨</td>\n",
       "      <td>道里区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7173</th>\n",
       "      <td>53045</td>\n",
       "      <td>安邦河湿地公园</td>\n",
       "      <td>4A</td>\n",
       "      <td>0.0</td>\n",
       "      <td>如璀璨的明珠镶嵌在广袤的安邦河湿地上</td>\n",
       "      <td>131.346389,46.9815</td>\n",
       "      <td>黑龙江·双鸭山·集贤县</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>双鸭山</td>\n",
       "      <td>集贤县</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7175</th>\n",
       "      <td>53047</td>\n",
       "      <td>美溪回龙湾国家森林公园</td>\n",
       "      <td>4A</td>\n",
       "      <td>0.0</td>\n",
       "      <td>幽静古朴，和谐自然的休闲观光佳境</td>\n",
       "      <td>129.223046,47.616708</td>\n",
       "      <td>黑龙江·伊春·美溪区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>伊春</td>\n",
       "      <td>美溪区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7189</th>\n",
       "      <td>53061</td>\n",
       "      <td>明月岛</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.8</td>\n",
       "      <td>岛上绿树成荫，花草丛生，自然景观琦丽</td>\n",
       "      <td>123.926031,47.379656</td>\n",
       "      <td>黑龙江·齐齐哈尔·龙江县</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>齐齐哈尔</td>\n",
       "      <td>龙江县</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7193</th>\n",
       "      <td>53065</td>\n",
       "      <td>大亮子河国家森林公园</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>古木奇伟、森林广奥、山石奇特、山水清幽</td>\n",
       "      <td>129.927036,46.747653</td>\n",
       "      <td>黑龙江·佳木斯·汤原县</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>佳木斯</td>\n",
       "      <td>汤原县</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1347 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      index         景点名称  星级   评分                   介绍                   经纬度  \\\n",
       "0         0           豫园  4A  4.2    “奇秀甲于东南”、“东南名园冠”。  121.498981,31.232772   \n",
       "2         2        上海欢乐谷  4A  3.6    游乐项目惊险刺激，特色表演异彩纷呈   121.22218,31.102491   \n",
       "4         4        上海动物园  4A  3.6        带你领略动物世界的纷繁多彩  121.369411,31.199264   \n",
       "6         6         东方绿舟  4A  3.5     全国首屈一指的青少年校外教育营地  121.015977,31.107866   \n",
       "7         7       上海影视乐园  4A  3.5  真实艺术地展现上海的历史风貌和人文景观  121.319396,31.016693   \n",
       "...     ...          ...  ..  ...                  ...                   ...   \n",
       "7171  53042     哈尔滨建筑艺术馆  4A  0.0    凝聚着音乐的优美旋律与建筑智慧之光  126.633625,45.776471   \n",
       "7173  53045      安邦河湿地公园  4A  0.0   如璀璨的明珠镶嵌在广袤的安邦河湿地上    131.346389,46.9815   \n",
       "7175  53047  美溪回龙湾国家森林公园  4A  0.0     幽静古朴，和谐自然的休闲观光佳境  129.223046,47.616708   \n",
       "7189  53061          明月岛  4A  3.8   岛上绿树成荫，花草丛生，自然景观琦丽  123.926031,47.379656   \n",
       "7193  53065   大亮子河国家森林公园  4A  3.6  古木奇伟、森林广奥、山石奇特、山水清幽  129.927036,46.747653   \n",
       "\n",
       "              所在地区  儿童旅客量   销售量     门票    省     市    区  \n",
       "0        上海·上海·黄浦区      0   820   39.8   上海    上海  黄浦区  \n",
       "2        上海·上海·松江区     55  4394  213.0   上海    上海  松江区  \n",
       "4        上海·上海·长宁区      0   642   39.9   上海    上海  长宁区  \n",
       "6        上海·上海·青浦区      4   384   44.0   上海    上海  青浦区  \n",
       "7        上海·上海·松江区      0   348   48.0   上海    上海  松江区  \n",
       "...            ...    ...   ...    ...  ...   ...  ...  \n",
       "7171   黑龙江·哈尔滨·道里区      0     0    0.0  黑龙江   哈尔滨  道里区  \n",
       "7173   黑龙江·双鸭山·集贤县      0     0    0.0  黑龙江   双鸭山  集贤县  \n",
       "7175    黑龙江·伊春·美溪区      0     0    0.0  黑龙江    伊春  美溪区  \n",
       "7189  黑龙江·齐齐哈尔·龙江县      0     0    0.0  黑龙江  齐齐哈尔  龙江县  \n",
       "7193   黑龙江·佳木斯·汤原县      1     0    0.0  黑龙江   佳木斯  汤原县  \n",
       "\n",
       "[1347 rows x 13 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 测试函数\n",
    "star('4A')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "def province(i):\n",
    "    \"\"\"\n",
    "    province是用于根据省条件查找相关景点的函数；\n",
    "    其中参数i 只能输入 字符串：\n",
    "            '上海', '吉林','陕西','湖南',\n",
    "             '重庆', '天津', '福建', '山东', '河北', '江苏',\n",
    "             '甘肃', '香港', '黑龙江', '北京', '宁夏','青海',\n",
    "             '江西', '海南', '贵州', '河南', '云南', '辽宁',\n",
    "             '四川', '安徽', '山西', '台湾', '广东', '西藏',\n",
    "             '新疆', '内蒙古', '广西', '浙江','湖北','澳门'\n",
    "    \"\"\"\n",
    "    省 = pd.unique(df_new['省'])\n",
    "    province_list =list(set(省))\n",
    "    if i in province_list:\n",
    "        province_choose=df_new[df_new['省'].isin([i])]\n",
    "        return province_choose"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "      <th>省</th>\n",
       "      <th>市</th>\n",
       "      <th>区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1288</th>\n",
       "      <td>10485</td>\n",
       "      <td>九寨沟</td>\n",
       "      <td>5A</td>\n",
       "      <td>5.0</td>\n",
       "      <td>传说中的童话天堂，你还在犹豫么</td>\n",
       "      <td>103.928015,33.271447</td>\n",
       "      <td>四川·阿坝藏族羌族自治州·九寨沟县</td>\n",
       "      <td>11</td>\n",
       "      <td>2676</td>\n",
       "      <td>0.8</td>\n",
       "      <td>四川</td>\n",
       "      <td>阿坝藏族羌族自治州</td>\n",
       "      <td>九寨沟县</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1289</th>\n",
       "      <td>10486</td>\n",
       "      <td>成都大熊猫繁育研究基地</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.0</td>\n",
       "      <td>无关黑与白， 不分胖与瘦， 可爱而又温暖</td>\n",
       "      <td>104.152603,30.738951</td>\n",
       "      <td>四川·成都·成华区</td>\n",
       "      <td>0</td>\n",
       "      <td>4302</td>\n",
       "      <td>27.0</td>\n",
       "      <td>四川</td>\n",
       "      <td>成都</td>\n",
       "      <td>成华区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1290</th>\n",
       "      <td>10487</td>\n",
       "      <td>国色天乡·陆地乐园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>来这里体验惊险刺激</td>\n",
       "      <td>103.835122,30.729492</td>\n",
       "      <td>四川·成都·国色天乡</td>\n",
       "      <td>0</td>\n",
       "      <td>4209</td>\n",
       "      <td>35.0</td>\n",
       "      <td>四川</td>\n",
       "      <td>成都</td>\n",
       "      <td>国色天乡</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1291</th>\n",
       "      <td>10488</td>\n",
       "      <td>乐山大佛</td>\n",
       "      <td>5A</td>\n",
       "      <td>4.1</td>\n",
       "      <td>摩崖石刻造像</td>\n",
       "      <td>103.779093,29.550402</td>\n",
       "      <td>四川·乐山·市中区</td>\n",
       "      <td>2</td>\n",
       "      <td>1782</td>\n",
       "      <td>80.0</td>\n",
       "      <td>四川</td>\n",
       "      <td>乐山</td>\n",
       "      <td>市中区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1292</th>\n",
       "      <td>10489</td>\n",
       "      <td>峨眉山</td>\n",
       "      <td>5A</td>\n",
       "      <td>5.0</td>\n",
       "      <td>云上金顶，天下峨眉</td>\n",
       "      <td>103.342036,29.522835</td>\n",
       "      <td>四川·乐山·峨眉山市</td>\n",
       "      <td>16</td>\n",
       "      <td>1818</td>\n",
       "      <td>160.0</td>\n",
       "      <td>四川</td>\n",
       "      <td>乐山</td>\n",
       "      <td>峨眉山市</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1498</th>\n",
       "      <td>10706</td>\n",
       "      <td>罗浮山羌王城</td>\n",
       "      <td>无</td>\n",
       "      <td>3.5</td>\n",
       "      <td>是古羌族的军事城堡，更是旅游的新景点</td>\n",
       "      <td>104.347274,31.594955</td>\n",
       "      <td>四川·绵阳·安县</td>\n",
       "      <td>0</td>\n",
       "      <td>30</td>\n",
       "      <td>35.0</td>\n",
       "      <td>四川</td>\n",
       "      <td>绵阳</td>\n",
       "      <td>安县</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1499</th>\n",
       "      <td>10707</td>\n",
       "      <td>报国寺</td>\n",
       "      <td>无</td>\n",
       "      <td>3.6</td>\n",
       "      <td>历史悠久，环境清幽，峨眉山八大寺庙之一</td>\n",
       "      <td>103.449947,29.574401</td>\n",
       "      <td>四川·乐山·峨眉山</td>\n",
       "      <td>0</td>\n",
       "      <td>68</td>\n",
       "      <td>100.0</td>\n",
       "      <td>四川</td>\n",
       "      <td>乐山</td>\n",
       "      <td>峨眉山</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1500</th>\n",
       "      <td>10708</td>\n",
       "      <td>唐家河</td>\n",
       "      <td>4A</td>\n",
       "      <td>0.0</td>\n",
       "      <td>美景,会让你对高效率的城市完全失忆</td>\n",
       "      <td>104.84029,32.550088</td>\n",
       "      <td>四川·广元·青川县</td>\n",
       "      <td>1</td>\n",
       "      <td>63</td>\n",
       "      <td>48.0</td>\n",
       "      <td>四川</td>\n",
       "      <td>广元</td>\n",
       "      <td>青川县</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1501</th>\n",
       "      <td>10709</td>\n",
       "      <td>光雾山小巫峡景区</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>蜀中一奇小巫峡，秦巴一绝穿花通天洞</td>\n",
       "      <td>106.940022,32.448422</td>\n",
       "      <td>四川·巴中·光雾山</td>\n",
       "      <td>0</td>\n",
       "      <td>84</td>\n",
       "      <td>30.0</td>\n",
       "      <td>四川</td>\n",
       "      <td>巴中</td>\n",
       "      <td>光雾山</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6967</th>\n",
       "      <td>52603</td>\n",
       "      <td>香港MAG环球3D魔幻馆（成都站）</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>本次『亚洲巡展•2014成都站』阵容强大！占地面积超过2000平方米，共展出50余套作品。全...</td>\n",
       "      <td>104.066304,30.656599</td>\n",
       "      <td>四川·成都·青羊区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>四川</td>\n",
       "      <td>成都</td>\n",
       "      <td>青羊区</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>215 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      index               景点名称  星级   评分  \\\n",
       "1288  10485                九寨沟  5A  5.0   \n",
       "1289  10486        成都大熊猫繁育研究基地  4A  4.0   \n",
       "1290  10487          国色天乡·陆地乐园   无  0.0   \n",
       "1291  10488               乐山大佛  5A  4.1   \n",
       "1292  10489                峨眉山  5A  5.0   \n",
       "...     ...                ...  ..  ...   \n",
       "1498  10706             罗浮山羌王城   无  3.5   \n",
       "1499  10707                报国寺   无  3.6   \n",
       "1500  10708                唐家河  4A  0.0   \n",
       "1501  10709           光雾山小巫峡景区   无  0.0   \n",
       "6967  52603  香港MAG环球3D魔幻馆（成都站）   无  0.0   \n",
       "\n",
       "                                                     介绍                   经纬度  \\\n",
       "1288                                    传说中的童话天堂，你还在犹豫么  103.928015,33.271447   \n",
       "1289                               无关黑与白， 不分胖与瘦， 可爱而又温暖  104.152603,30.738951   \n",
       "1290                                          来这里体验惊险刺激  103.835122,30.729492   \n",
       "1291                                             摩崖石刻造像  103.779093,29.550402   \n",
       "1292                                          云上金顶，天下峨眉  103.342036,29.522835   \n",
       "...                                                 ...                   ...   \n",
       "1498                                 是古羌族的军事城堡，更是旅游的新景点  104.347274,31.594955   \n",
       "1499                                历史悠久，环境清幽，峨眉山八大寺庙之一  103.449947,29.574401   \n",
       "1500                                  美景,会让你对高效率的城市完全失忆   104.84029,32.550088   \n",
       "1501                                  蜀中一奇小巫峡，秦巴一绝穿花通天洞  106.940022,32.448422   \n",
       "6967  本次『亚洲巡展•2014成都站』阵容强大！占地面积超过2000平方米，共展出50余套作品。全...  104.066304,30.656599   \n",
       "\n",
       "                   所在地区  儿童旅客量   销售量     门票   省          市     区  \n",
       "1288  四川·阿坝藏族羌族自治州·九寨沟县     11  2676    0.8  四川  阿坝藏族羌族自治州  九寨沟县  \n",
       "1289          四川·成都·成华区      0  4302   27.0  四川         成都   成华区  \n",
       "1290         四川·成都·国色天乡      0  4209   35.0  四川         成都  国色天乡  \n",
       "1291          四川·乐山·市中区      2  1782   80.0  四川         乐山   市中区  \n",
       "1292         四川·乐山·峨眉山市     16  1818  160.0  四川         乐山  峨眉山市  \n",
       "...                 ...    ...   ...    ...  ..        ...   ...  \n",
       "1498           四川·绵阳·安县      0    30   35.0  四川         绵阳    安县  \n",
       "1499          四川·乐山·峨眉山      0    68  100.0  四川         乐山   峨眉山  \n",
       "1500          四川·广元·青川县      1    63   48.0  四川         广元   青川县  \n",
       "1501          四川·巴中·光雾山      0    84   30.0  四川         巴中   光雾山  \n",
       "6967          四川·成都·青羊区      0     0    0.0  四川         成都   青羊区  \n",
       "\n",
       "[215 rows x 13 columns]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "province('四川')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "price_list = ['免费','20元以下','20-50元',\n",
    "              '50-100元','100-150元','150-200元',\n",
    "              '200-250元','200-300元','300以上']\n",
    "def price(i):\n",
    "    \"\"\"\n",
    "    price是用于根据景点门票条件查找相关景点的函数；\n",
    "    其中参数i 只能输入 字符串：\n",
    "                    '免费','20元以下','20-50元',\n",
    "                    '50-100元','100-150元','150-200元',\n",
    "                    '200-300元','300元以上'\n",
    "    \"\"\"\n",
    "    if i in price_list[0]:\n",
    "        price_choose=df_new[(df_new[\"门票\"]==0.0)]\n",
    "    elif i in price_list[1]:\n",
    "        price_choose=df_new[(df_new[\"门票\"]>=20.0)]\n",
    "    elif i in price_list[2]:\n",
    "        price_choose=df_new[(df_new[\"门票\"]>20.0)&(df_new[\"门票\"]<50.0)]\n",
    "    elif i in price_list[3]:\n",
    "        price_choose=df_new[(df_new[\"门票\"]>=50.0)&(df_new[\"门票\"]<100.0)]\n",
    "    elif i in price_list[4]:\n",
    "        price_choose=df_new[(df_new[\"门票\"]>=100.0)&(df_new[\"门票\"]<150.0)]\n",
    "    elif i in price_list[5]:\n",
    "        price_choose=df_new[(df_new[\"门票\"]>=150.0)&(df_new[\"门票\"]<200.0)]\n",
    "    elif i in price_list[6]:\n",
    "        price_choose=df_new[(df_new[\"门票\"]>200.0)&(df_new[\"门票\"]<300.0)]\n",
    "    else:\n",
    "        price_choose=df_new[(df_new[\"门票\"]>=300.0)]        \n",
    "    return price_choose"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "      <th>省</th>\n",
       "      <th>市</th>\n",
       "      <th>区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9</td>\n",
       "      <td>上海杜莎夫人蜡像馆</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.7</td>\n",
       "      <td>走自己的红毯，与世界明星相遇</td>\n",
       "      <td>121.480215,31.240715</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>12</td>\n",
       "      <td>129.6</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>黄浦区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>12</td>\n",
       "      <td>金茂大厦88层观光厅</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.8</td>\n",
       "      <td>上海就在脚下</td>\n",
       "      <td>121.512094,31.240746</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>12</td>\n",
       "      <td>127.7</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>13</td>\n",
       "      <td>环球金融中心观光厅</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>来上海登三高，眺望魔都霓虹闪烁</td>\n",
       "      <td>121.513463,31.23965</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>1</td>\n",
       "      <td>14</td>\n",
       "      <td>135.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>39</td>\n",
       "      <td>锦江乐园</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>不仅是孩子的乐园，更是成人的梦工厂</td>\n",
       "      <td>121.417416,31.146669</td>\n",
       "      <td>上海·上海·闵行区</td>\n",
       "      <td>3</td>\n",
       "      <td>110</td>\n",
       "      <td>148.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>闵行区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>41</td>\n",
       "      <td>上海都市旅游观光巴士</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>在双层敞篷观光车上饱览上海城市风光</td>\n",
       "      <td>121.483421,31.240749</td>\n",
       "      <td>上海·上海·静安区</td>\n",
       "      <td>0</td>\n",
       "      <td>30</td>\n",
       "      <td>106.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>静安区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6883</th>\n",
       "      <td>52519</td>\n",
       "      <td>香港张保仔游船</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>迎着海风倚靠着舒适的沙发床，夜景叹为观止</td>\n",
       "      <td>114.172533,22.289567</td>\n",
       "      <td>香港·香港·尖沙咀</td>\n",
       "      <td>0</td>\n",
       "      <td>32</td>\n",
       "      <td>128.0</td>\n",
       "      <td>香港</td>\n",
       "      <td>香港</td>\n",
       "      <td>尖沙咀</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6884</th>\n",
       "      <td>52520</td>\n",
       "      <td>香港挪亚方舟</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>穿梭非凡之旅！让孩子越玩越聪明。</td>\n",
       "      <td>114.072263,22.350494</td>\n",
       "      <td>香港·香港·新界</td>\n",
       "      <td>3</td>\n",
       "      <td>43</td>\n",
       "      <td>100.0</td>\n",
       "      <td>香港</td>\n",
       "      <td>香港</td>\n",
       "      <td>新界</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6886</th>\n",
       "      <td>52522</td>\n",
       "      <td>港珠澳大桥人工岛</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>连接香港和珠海</td>\n",
       "      <td>113.50313704280622,22.28794573500327</td>\n",
       "      <td>香港·香港</td>\n",
       "      <td>0</td>\n",
       "      <td>66</td>\n",
       "      <td>136.0</td>\n",
       "      <td>香港</td>\n",
       "      <td>香港</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7083</th>\n",
       "      <td>52954</td>\n",
       "      <td>哈尔滨刘老根大舞台</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>刘老根大舞台的特色是二人转表演</td>\n",
       "      <td>126.659961,45.755537</td>\n",
       "      <td>黑龙江·哈尔滨·南岗区</td>\n",
       "      <td>0</td>\n",
       "      <td>88</td>\n",
       "      <td>130.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>哈尔滨</td>\n",
       "      <td>南岗区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7093</th>\n",
       "      <td>52964</td>\n",
       "      <td>伊春小兴安岭石林</td>\n",
       "      <td>无</td>\n",
       "      <td>3.5</td>\n",
       "      <td>展翅大鹏、嬉戏石猴、翘首悟能</td>\n",
       "      <td>129.45909124058,48.464751974396</td>\n",
       "      <td>黑龙江·伊春·汤旺河区</td>\n",
       "      <td>0</td>\n",
       "      <td>88</td>\n",
       "      <td>100.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>伊春</td>\n",
       "      <td>汤旺河区</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>603 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      index        景点名称  星级   评分                    介绍  \\\n",
       "9         9   上海杜莎夫人蜡像馆  4A  3.7        走自己的红毯，与世界明星相遇   \n",
       "12       12  金茂大厦88层观光厅  4A  3.8                上海就在脚下   \n",
       "13       13   环球金融中心观光厅  4A  3.6       来上海登三高，眺望魔都霓虹闪烁   \n",
       "39       39        锦江乐园  4A  3.6     不仅是孩子的乐园，更是成人的梦工厂   \n",
       "41       41  上海都市旅游观光巴士   无  0.0     在双层敞篷观光车上饱览上海城市风光   \n",
       "...     ...         ...  ..  ...                   ...   \n",
       "6883  52519     香港张保仔游船   无  0.0  迎着海风倚靠着舒适的沙发床，夜景叹为观止   \n",
       "6884  52520      香港挪亚方舟   无  0.0      穿梭非凡之旅！让孩子越玩越聪明。   \n",
       "6886  52522    港珠澳大桥人工岛   无  0.0               连接香港和珠海   \n",
       "7083  52954   哈尔滨刘老根大舞台   无  0.0       刘老根大舞台的特色是二人转表演   \n",
       "7093  52964    伊春小兴安岭石林   无  3.5        展翅大鹏、嬉戏石猴、翘首悟能   \n",
       "\n",
       "                                       经纬度         所在地区  儿童旅客量  销售量     门票  \\\n",
       "9                     121.480215,31.240715    上海·上海·黄浦区      0   12  129.6   \n",
       "12                    121.512094,31.240746   上海·上海·浦东新区      0   12  127.7   \n",
       "13                     121.513463,31.23965   上海·上海·浦东新区      1   14  135.0   \n",
       "39                    121.417416,31.146669    上海·上海·闵行区      3  110  148.0   \n",
       "41                    121.483421,31.240749    上海·上海·静安区      0   30  106.0   \n",
       "...                                    ...          ...    ...  ...    ...   \n",
       "6883                  114.172533,22.289567    香港·香港·尖沙咀      0   32  128.0   \n",
       "6884                  114.072263,22.350494     香港·香港·新界      3   43  100.0   \n",
       "6886  113.50313704280622,22.28794573500327        香港·香港      0   66  136.0   \n",
       "7083                  126.659961,45.755537  黑龙江·哈尔滨·南岗区      0   88  130.0   \n",
       "7093       129.45909124058,48.464751974396  黑龙江·伊春·汤旺河区      0   88  100.0   \n",
       "\n",
       "        省    市     区  \n",
       "9      上海   上海   黄浦区  \n",
       "12     上海   上海  浦东新区  \n",
       "13     上海   上海  浦东新区  \n",
       "39     上海   上海   闵行区  \n",
       "41     上海   上海   静安区  \n",
       "...   ...  ...   ...  \n",
       "6883   香港   香港   尖沙咀  \n",
       "6884   香港   香港    新界  \n",
       "6886   香港   香港   NaN  \n",
       "7083  黑龙江  哈尔滨   南岗区  \n",
       "7093  黑龙江   伊春  汤旺河区  \n",
       "\n",
       "[603 rows x 13 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "price('100-150元')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 选择省份，根据销量排序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "      <th>省</th>\n",
       "      <th>市</th>\n",
       "      <th>区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>上海欢乐谷</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>游乐项目惊险刺激，特色表演异彩纷呈</td>\n",
       "      <td>121.22218,31.102491</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>55</td>\n",
       "      <td>4394</td>\n",
       "      <td>213.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>松江区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>上海海昌海洋公园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>感受海洋公园乐趣</td>\n",
       "      <td>121.915647,30.917713</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>18</td>\n",
       "      <td>4094</td>\n",
       "      <td>178.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>上海野生动物园</td>\n",
       "      <td>5A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>与野生动物近距离的“亲密接触”</td>\n",
       "      <td>121.728112,31.059636</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>2667</td>\n",
       "      <td>17.1</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>8</td>\n",
       "      <td>浦江郊野公园奇迹花园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>来奇迹花园开启一段花之奇旅吧</td>\n",
       "      <td>121.509672,31.060409</td>\n",
       "      <td>上海·上海·闵行区</td>\n",
       "      <td>0</td>\n",
       "      <td>1074</td>\n",
       "      <td>49.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>闵行区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>27</td>\n",
       "      <td>上海周浦花海</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>一年四季鲜花不断，汇成令人迷醉的花海</td>\n",
       "      <td>121.65535,31.118973</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>826</td>\n",
       "      <td>39.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159</th>\n",
       "      <td>159</td>\n",
       "      <td>上海海洋水族馆</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.7</td>\n",
       "      <td>穿越世界，来一次终生难忘的海洋之旅</td>\n",
       "      <td>121.50818,31.246234</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>158</th>\n",
       "      <td>158</td>\n",
       "      <td>东方明珠一日游</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>全方位的展现上海风貌</td>\n",
       "      <td>121.506377,31.245105</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>157</th>\n",
       "      <td>157</td>\n",
       "      <td>3D魔幻趣味馆</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>你就是画中主角</td>\n",
       "      <td>121.50356,31.244489</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>156</th>\n",
       "      <td>156</td>\n",
       "      <td>上海巧克力开心乐园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>一个由巧克力搭建的开心集结地</td>\n",
       "      <td>121.48176,31.187927</td>\n",
       "      <td>上海·上海·上海世博园</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海世博园</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>214</th>\n",
       "      <td>224</td>\n",
       "      <td>环球奇趣体验馆</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>一馆玩遍世界超新奇趣体验</td>\n",
       "      <td>121.497752,31.232364</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>黄浦区</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>215 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     index        景点名称  星级   评分                  介绍                   经纬度  \\\n",
       "2        2       上海欢乐谷  4A  3.6   游乐项目惊险刺激，特色表演异彩纷呈   121.22218,31.102491   \n",
       "3        3    上海海昌海洋公园   无  0.0            感受海洋公园乐趣  121.915647,30.917713   \n",
       "1        1     上海野生动物园  5A  3.6     与野生动物近距离的“亲密接触”  121.728112,31.059636   \n",
       "8        8  浦江郊野公园奇迹花园   无  0.0      来奇迹花园开启一段花之奇旅吧  121.509672,31.060409   \n",
       "27      27      上海周浦花海   无  0.0  一年四季鲜花不断，汇成令人迷醉的花海   121.65535,31.118973   \n",
       "..     ...         ...  ..  ...                 ...                   ...   \n",
       "159    159     上海海洋水族馆  4A  3.7   穿越世界，来一次终生难忘的海洋之旅   121.50818,31.246234   \n",
       "158    158     东方明珠一日游   无  0.0          全方位的展现上海风貌  121.506377,31.245105   \n",
       "157    157     3D魔幻趣味馆   无  0.0             你就是画中主角   121.50356,31.244489   \n",
       "156    156   上海巧克力开心乐园   无  0.0      一个由巧克力搭建的开心集结地   121.48176,31.187927   \n",
       "214    224     环球奇趣体验馆   无  0.0        一馆玩遍世界超新奇趣体验  121.497752,31.232364   \n",
       "\n",
       "            所在地区  儿童旅客量   销售量     门票   省   市      区  \n",
       "2      上海·上海·松江区     55  4394  213.0  上海  上海    松江区  \n",
       "3     上海·上海·浦东新区     18  4094  178.0  上海  上海   浦东新区  \n",
       "1     上海·上海·浦东新区      0  2667   17.1  上海  上海   浦东新区  \n",
       "8      上海·上海·闵行区      0  1074   49.0  上海  上海    闵行区  \n",
       "27    上海·上海·浦东新区      0   826   39.0  上海  上海   浦东新区  \n",
       "..           ...    ...   ...    ...  ..  ..    ...  \n",
       "159   上海·上海·浦东新区      0     0    0.0  上海  上海   浦东新区  \n",
       "158   上海·上海·浦东新区      0     0    0.0  上海  上海   浦东新区  \n",
       "157   上海·上海·浦东新区      0     0    0.0  上海  上海   浦东新区  \n",
       "156  上海·上海·上海世博园      0     0    0.0  上海  上海  上海世博园  \n",
       "214    上海·上海·黄浦区      0     0    0.0  上海  上海    黄浦区  \n",
       "\n",
       "[215 rows x 13 columns]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_new[df_new.省.str.contains('上海')].sort_values('销售量',ascending=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# （新）选择省份，根据儿童旅客量排序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "      <th>省</th>\n",
       "      <th>市</th>\n",
       "      <th>区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>上海欢乐谷</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>游乐项目惊险刺激，特色表演异彩纷呈</td>\n",
       "      <td>121.22218,31.102491</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>55</td>\n",
       "      <td>4394</td>\n",
       "      <td>213.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>松江区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>34</td>\n",
       "      <td>上海迪士尼乐园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>点亮心中奇梦</td>\n",
       "      <td>121.667917,31.149712</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>27</td>\n",
       "      <td>54</td>\n",
       "      <td>1199.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>上海海昌海洋公园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>感受海洋公园乐趣</td>\n",
       "      <td>121.915647,30.917713</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>18</td>\n",
       "      <td>4094</td>\n",
       "      <td>178.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>14</td>\n",
       "      <td>朱家角古镇</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>素有“上海威尼斯”及“沪郊好莱坞”之誉</td>\n",
       "      <td>121.061605,31.116917</td>\n",
       "      <td>上海·上海·青浦区</td>\n",
       "      <td>13</td>\n",
       "      <td>20</td>\n",
       "      <td>0.8</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>青浦区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>53</td>\n",
       "      <td>上海世博园</td>\n",
       "      <td>无</td>\n",
       "      <td>4.1</td>\n",
       "      <td>追忆昔日世博盛况</td>\n",
       "      <td>121.490185,31.199998</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>8</td>\n",
       "      <td>35</td>\n",
       "      <td>80.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>85</td>\n",
       "      <td>上海木文化博物馆</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>风格迥异，各具特色的展厅</td>\n",
       "      <td>121.41809,31.315584</td>\n",
       "      <td>上海·上海·宝山区</td>\n",
       "      <td>0</td>\n",
       "      <td>87</td>\n",
       "      <td>15.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>宝山区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>86</td>\n",
       "      <td>汤易得温泉馆</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>一站式娱乐休闲场所</td>\n",
       "      <td>121.137659,31.268559</td>\n",
       "      <td>上海·上海·青浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>99</td>\n",
       "      <td>48.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>青浦区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>87</td>\n",
       "      <td>高家庄园</td>\n",
       "      <td>3A</td>\n",
       "      <td>0.0</td>\n",
       "      <td>高雅的景区、温馨的家园、美丽的田庄</td>\n",
       "      <td>121.433446,31.686413</td>\n",
       "      <td>上海·上海·崇明岛</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>60.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>崇明岛</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>88</td>\n",
       "      <td>中国3D打印文化博物馆</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>121.44132,31.350387</td>\n",
       "      <td>上海·上海·宝山区</td>\n",
       "      <td>0</td>\n",
       "      <td>73</td>\n",
       "      <td>35.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>宝山区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>214</th>\n",
       "      <td>224</td>\n",
       "      <td>环球奇趣体验馆</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>一馆玩遍世界超新奇趣体验</td>\n",
       "      <td>121.497752,31.232364</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>黄浦区</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>215 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     index         景点名称  星级   评分                   介绍                   经纬度  \\\n",
       "2        2        上海欢乐谷  4A  3.6    游乐项目惊险刺激，特色表演异彩纷呈   121.22218,31.102491   \n",
       "34      34      上海迪士尼乐园   无  0.0               点亮心中奇梦  121.667917,31.149712   \n",
       "3        3     上海海昌海洋公园   无  0.0             感受海洋公园乐趣  121.915647,30.917713   \n",
       "14      14        朱家角古镇  4A  3.6  素有“上海威尼斯”及“沪郊好莱坞”之誉  121.061605,31.116917   \n",
       "53      53        上海世博园   无  4.1             追忆昔日世博盛况  121.490185,31.199998   \n",
       "..     ...          ...  ..  ...                  ...                   ...   \n",
       "85      85     上海木文化博物馆   无  0.0         风格迥异，各具特色的展厅   121.41809,31.315584   \n",
       "86      86       汤易得温泉馆   无  0.0            一站式娱乐休闲场所  121.137659,31.268559   \n",
       "87      87         高家庄园  3A  0.0    高雅的景区、温馨的家园、美丽的田庄  121.433446,31.686413   \n",
       "88      88  中国3D打印文化博物馆   无  0.0                  NaN   121.44132,31.350387   \n",
       "214    224      环球奇趣体验馆   无  0.0         一馆玩遍世界超新奇趣体验  121.497752,31.232364   \n",
       "\n",
       "           所在地区  儿童旅客量   销售量      门票   省   市     区  \n",
       "2     上海·上海·松江区     55  4394   213.0  上海  上海   松江区  \n",
       "34   上海·上海·浦东新区     27    54  1199.0  上海  上海  浦东新区  \n",
       "3    上海·上海·浦东新区     18  4094   178.0  上海  上海  浦东新区  \n",
       "14    上海·上海·青浦区     13    20     0.8  上海  上海   青浦区  \n",
       "53   上海·上海·浦东新区      8    35    80.0  上海  上海  浦东新区  \n",
       "..          ...    ...   ...     ...  ..  ..   ...  \n",
       "85    上海·上海·宝山区      0    87    15.0  上海  上海   宝山区  \n",
       "86    上海·上海·青浦区      0    99    48.0  上海  上海   青浦区  \n",
       "87    上海·上海·崇明岛      0     8    60.0  上海  上海   崇明岛  \n",
       "88    上海·上海·宝山区      0    73    35.0  上海  上海   宝山区  \n",
       "214   上海·上海·黄浦区      0     0     0.0  上海  上海   黄浦区  \n",
       "\n",
       "[215 rows x 13 columns]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "children_ascending_df = df_new[df_new.省.str.contains('上海')].sort_values('儿童旅客量',ascending=False)\n",
    "children_ascending_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "def c_province(i):\n",
    "    \"\"\"\n",
    "    province是用于根据省条件查找相关景点的函数；\n",
    "    其中参数i 只能输入 字符串：\n",
    "            '上海', '吉林','陕西','湖南',\n",
    "             '重庆', '天津', '福建', '山东', '河北', '江苏',\n",
    "             '甘肃', '香港', '黑龙江', '北京', '宁夏','青海',\n",
    "             '江西', '海南', '贵州', '河南', '云南', '辽宁',\n",
    "             '四川', '安徽', '山西', '台湾', '广东', '西藏',\n",
    "             '新疆', '内蒙古', '广西', '浙江','湖北','澳门'\n",
    "    \"\"\"\n",
    "    省 = pd.unique(df_new['省'])\n",
    "    province_list =list(set(省))\n",
    "    if i in province_list:\n",
    "        province_choose=df_new[df_new['省'].isin([i])].sort_values('销售量',ascending=False)[0:10]\n",
    "        sightseeing = province_choose['景点名称'].tolist()\n",
    "        children_count = province_choose['销售量'].tolist()\n",
    "        return sightseeing,children_count"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['北京野生动物园',\n",
       " '七彩云南欢乐世界',\n",
       " '梵净山',\n",
       " '上海欢乐谷',\n",
       " '成都大熊猫繁育研究基地',\n",
       " '国色天乡·陆地乐园',\n",
       " '上海海昌海洋公园',\n",
       " '百里杜鹃',\n",
       " '秦始皇帝陵博物院（兵马俑）',\n",
       " '大连森林动物园']"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "jd_top10 = df_new.sort_values('销售量',ascending=False)[0:10]\n",
    "jd_top10_name = jd_top10['景点名称'].tolist()\n",
    "jd_top10_num = jd_top10['销售量'].tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(['上海欢乐谷',\n",
       "  '上海海昌海洋公园',\n",
       "  '上海野生动物园',\n",
       "  '浦江郊野公园奇迹花园',\n",
       "  '上海周浦花海',\n",
       "  '豫园',\n",
       "  '上海动物园',\n",
       "  '上海海湾国家森林公园',\n",
       "  '滨江森林公园',\n",
       "  '东方绿舟'],\n",
       " [4394, 4094, 2667, 1074, 826, 820, 642, 580, 450, 384])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c_province('上海')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "ERROR:lml.utils:failed to import pyecharts_snapshot\n",
      "Traceback (most recent call last):\n",
      "  File \"C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\lml\\utils.py\", line 43, in do_import\n",
      "    plugin_module = __import__(plugin_module_name)\n",
      "ModuleNotFoundError: No module named 'pyecharts_snapshot'\n"
     ]
    },
    {
     "ename": "ImportError",
     "evalue": "cannot import name 'options' from 'pyecharts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\__init__.py)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mImportError\u001b[0m                               Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-24-fd949d8d3435>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0moptions\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mopts\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mFunnel\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfaker\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mFaker\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mImportError\u001b[0m: cannot import name 'options' from 'pyecharts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\__init__.py)"
     ]
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Funnel\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "\n",
    "c = (\n",
    "    Funnel()\n",
    "    .add(\n",
    "        \"景点\",\n",
    "        [list(z) for z in zip(c_province('上海')[0], c_province('上海')[1])],\n",
    "        label_opts=opts.LabelOpts(position=\"inside\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"该城市最受欢迎的十大景点\"),\n",
    "        legend_opts=opts.LegendOpts(\n",
    "            # 是否显示图例组件\n",
    "            is_show = True,\n",
    "            type_ = 'plain',\n",
    "            selected_mode = True,\n",
    "            pos_left = '70%',\n",
    "            pos_bottom='20%'\n",
    "        )\n",
    "    \n",
    "    )\n",
    "    .render(\"funnel_label_inside.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 查看不同价位区间消费情况"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import plotly as py\n",
    "import plotly.graph_objs as go\n",
    "import plotly.offline as of "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 建立消费群体:消费群体数量 字典"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "消费群体_list = [\n",
    "    '50元以下','50-100元','100-200元',\n",
    "    '200-300元','300-500元','500-700元',\n",
    "    '700元以上'\n",
    "]\n",
    "\n",
    "choose=df_new[(df_new[\"门票\"]<=50.0)]\n",
    "消费群体1 = choose['销售量'].sum()\n",
    "choose=df_new[(df_new[\"门票\"]>50.0)&(df_new[\"门票\"]<=100.0)]\n",
    "消费群体2 = choose['销售量'].sum()\n",
    "choose=df_new[(df_new[\"门票\"]>100.0)&(df_new[\"门票\"]<=200.0)]\n",
    "消费群体3 =choose['销售量'].sum()\n",
    "choose=df_new[(df_new[\"门票\"]>200.0)&(df_new[\"门票\"]<=300.0)]\n",
    "消费群体4 =choose['销售量'].sum()\n",
    "choose=df_new[(df_new[\"门票\"]>300.0)&(df_new[\"门票\"]<=500.0)]\n",
    "消费群体5 =choose['销售量'].sum()\n",
    "choose=df_new[(df_new[\"门票\"]>500.0)&(df_new[\"门票\"]<=700.0)]\n",
    "消费群体6 =choose['销售量'].sum()\n",
    "choose=df_new[(df_new[\"门票\"]>700.0)]\n",
    "消费群体7 =choose['销售量'].sum()\n",
    "\n",
    "消费群体数量_list = [\n",
    "    消费群体1,消费群体2,消费群体3,\n",
    "    消费群体4,消费群体5,消费群体6,\n",
    "    消费群体7\n",
    "]\n",
    "消费群体_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name '消费群体数量_list' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-25-5845a5850921>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0m消费群体数量_list\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m: name '消费群体数量_list' is not defined"
     ]
    }
   ],
   "source": [
    "消费群体数量_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name '消费群体_list' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-26-87532059fcd7>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0m不同价位区间消费情况_dict\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdict\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mzip\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0m消费群体_list\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0m消费群体数量_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[0m不同价位区间消费情况_dict\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name '消费群体_list' is not defined"
     ]
    }
   ],
   "source": [
    "不同价位区间消费情况_dict = dict(zip(消费群体_list,消费群体数量_list))\n",
    "不同价位区间消费情况_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name '不同价位区间消费情况_dict' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-27-e309f3d96288>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mdf_不同价位区间消费情况0\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mDataFrame\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0m不同价位区间消费情况_dict\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mindex\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mT\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreset_index\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[0mdf_不同价位区间消费情况0\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcolumns\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;34m'价格区间'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'消费人群总量'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[0mdf_不同价位区间消费情况\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdf_不同价位区间消费情况0\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msort_values\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'消费人群总量'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mascending\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m \u001b[0mdf_不同价位区间消费情况\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name '不同价位区间消费情况_dict' is not defined"
     ]
    }
   ],
   "source": [
    "df_不同价位区间消费情况0 = pd.DataFrame(不同价位区间消费情况_dict,index=[0]).T.reset_index()\n",
    "df_不同价位区间消费情况0.columns = ['价格区间','消费人群总量']\n",
    "df_不同价位区间消费情况 = df_不同价位区间消费情况0.sort_values('消费人群总量',ascending=False)\n",
    "df_不同价位区间消费情况"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 绘制不同价位区间消费情况-饼状图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "import plotly.express as px"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'df_不同价位区间消费情况' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-29-7d4673403f5d>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m fig = px.pie(\n\u001b[1;32m----> 2\u001b[1;33m     \u001b[0mdf_不同价位区间消费情况\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      3\u001b[0m     \u001b[0mnames\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mdf_不同价位区间消费情况\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'价格区间'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m     \u001b[0mvalues\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mdf_不同价位区间消费情况\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'消费人群总量'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m     \u001b[0mtitle\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m'不同价位区间消费情况'\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'df_不同价位区间消费情况' is not defined"
     ]
    }
   ],
   "source": [
    "fig = px.pie(\n",
    "    df_不同价位区间消费情况,\n",
    "    names=df_不同价位区间消费情况['价格区间'],\n",
    "    values=df_不同价位区间消费情况['消费人群总量'],\n",
    "    title='不同价位区间消费情况'\n",
    ")\n",
    "of.plot(fig)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'df_不同价位区间消费情况' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-30-3917dcdb47a7>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mplotly\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgraph_objects\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mgo\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      2\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[0mlabels\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdf_不同价位区间消费情况\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'价格区间'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      4\u001b[0m \u001b[0mvalues\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdf_不同价位区间消费情况\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'消费人群总量'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'df_不同价位区间消费情况' is not defined"
     ]
    }
   ],
   "source": [
    "import plotly.graph_objects as go\n",
    "\n",
    "labels = df_不同价位区间消费情况['价格区间']\n",
    "values = df_不同价位区间消费情况['消费人群总量']\n",
    "\n",
    "fig = go.Figure(data=[go.Pie(labels=labels, values=values, textinfo='label+percent',\n",
    "                             insidetextorientation='radial'\n",
    "                            )])\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "      <th>省</th>\n",
       "      <th>市</th>\n",
       "      <th>区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>上海欢乐谷</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>游乐项目惊险刺激，特色表演异彩纷呈</td>\n",
       "      <td>121.22218,31.102491</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>55</td>\n",
       "      <td>4394</td>\n",
       "      <td>213.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>松江区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>702</th>\n",
       "      <td>4648</td>\n",
       "      <td>十渡风景区</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>远离城市喧嚣，感受自然之美</td>\n",
       "      <td>115.606468,39.644162</td>\n",
       "      <td>北京·北京·房山区</td>\n",
       "      <td>35</td>\n",
       "      <td>4</td>\n",
       "      <td>95.0</td>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>房山区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1931</th>\n",
       "      <td>14175</td>\n",
       "      <td>黄山风景区</td>\n",
       "      <td>5A</td>\n",
       "      <td>5.0</td>\n",
       "      <td>五岳归来不看山，黄山归来不看岳</td>\n",
       "      <td>118.193977,30.097967</td>\n",
       "      <td>安徽·黄山·黄山区</td>\n",
       "      <td>37</td>\n",
       "      <td>1410</td>\n",
       "      <td>240.0</td>\n",
       "      <td>安徽</td>\n",
       "      <td>黄山</td>\n",
       "      <td>黄山区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2592</th>\n",
       "      <td>20209</td>\n",
       "      <td>长隆欢乐世界</td>\n",
       "      <td>5A</td>\n",
       "      <td>0.0</td>\n",
       "      <td>垂直过山车等挑战你的青春荷尔蒙</td>\n",
       "      <td>113.33789,23.005235</td>\n",
       "      <td>广东·广州·广州长隆旅游度假区</td>\n",
       "      <td>38</td>\n",
       "      <td>10</td>\n",
       "      <td>214.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>广州</td>\n",
       "      <td>广州长隆旅游度假区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4075</th>\n",
       "      <td>35716</td>\n",
       "      <td>千岛湖</td>\n",
       "      <td>5A</td>\n",
       "      <td>3.9</td>\n",
       "      <td>亲近大自然，放飞心情</td>\n",
       "      <td>119.027854,29.605088</td>\n",
       "      <td>浙江·杭州·淳安县</td>\n",
       "      <td>90</td>\n",
       "      <td>804</td>\n",
       "      <td>35.0</td>\n",
       "      <td>浙江</td>\n",
       "      <td>杭州</td>\n",
       "      <td>淳安县</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4096</th>\n",
       "      <td>35737</td>\n",
       "      <td>西湖</td>\n",
       "      <td>5A</td>\n",
       "      <td>5.0</td>\n",
       "      <td>在这里邂逅你的白娘子吧</td>\n",
       "      <td>120.153384,30.236492</td>\n",
       "      <td>浙江·杭州·西湖区</td>\n",
       "      <td>31</td>\n",
       "      <td>26</td>\n",
       "      <td>40.0</td>\n",
       "      <td>浙江</td>\n",
       "      <td>杭州</td>\n",
       "      <td>西湖区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4303</th>\n",
       "      <td>39809</td>\n",
       "      <td>亚龙湾</td>\n",
       "      <td>4A</td>\n",
       "      <td>5.0</td>\n",
       "      <td>湛蓝天宇映衬着碧波万顷，景象万千</td>\n",
       "      <td>109.654555,18.236153</td>\n",
       "      <td>海南·三亚</td>\n",
       "      <td>40</td>\n",
       "      <td>288</td>\n",
       "      <td>90.0</td>\n",
       "      <td>海南</td>\n",
       "      <td>三亚</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4316</th>\n",
       "      <td>39822</td>\n",
       "      <td>三亚湾</td>\n",
       "      <td>无</td>\n",
       "      <td>4.3</td>\n",
       "      <td>滨海大道依湾绵延，椰树成林构成一道画廊</td>\n",
       "      <td>109.451034,18.292751</td>\n",
       "      <td>海南·三亚</td>\n",
       "      <td>31</td>\n",
       "      <td>116</td>\n",
       "      <td>27.0</td>\n",
       "      <td>海南</td>\n",
       "      <td>三亚</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5355</th>\n",
       "      <td>44824</td>\n",
       "      <td>鼓浪屿</td>\n",
       "      <td>5A</td>\n",
       "      <td>4.9</td>\n",
       "      <td>琴之岛，乐之屿</td>\n",
       "      <td>118.073486,24.452261</td>\n",
       "      <td>福建·厦门·思明区</td>\n",
       "      <td>30</td>\n",
       "      <td>614</td>\n",
       "      <td>25.0</td>\n",
       "      <td>福建</td>\n",
       "      <td>厦门</td>\n",
       "      <td>思明区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6863</th>\n",
       "      <td>52499</td>\n",
       "      <td>尖沙咀</td>\n",
       "      <td>无</td>\n",
       "      <td>4.5</td>\n",
       "      <td>这里可饱览维多利亚港的全景</td>\n",
       "      <td>114.174535177,22.300819397</td>\n",
       "      <td>香港·香港·九龙</td>\n",
       "      <td>31</td>\n",
       "      <td>33</td>\n",
       "      <td>167.0</td>\n",
       "      <td>香港</td>\n",
       "      <td>香港</td>\n",
       "      <td>九龙</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      index    景点名称  星级   评分                   介绍                         经纬度  \\\n",
       "2         2   上海欢乐谷  4A  3.6    游乐项目惊险刺激，特色表演异彩纷呈         121.22218,31.102491   \n",
       "702    4648   十渡风景区  4A  3.6        远离城市喧嚣，感受自然之美        115.606468,39.644162   \n",
       "1931  14175   黄山风景区  5A  5.0      五岳归来不看山，黄山归来不看岳        118.193977,30.097967   \n",
       "2592  20209  长隆欢乐世界  5A  0.0      垂直过山车等挑战你的青春荷尔蒙         113.33789,23.005235   \n",
       "4075  35716     千岛湖  5A  3.9           亲近大自然，放飞心情        119.027854,29.605088   \n",
       "4096  35737      西湖  5A  5.0          在这里邂逅你的白娘子吧        120.153384,30.236492   \n",
       "4303  39809     亚龙湾  4A  5.0     湛蓝天宇映衬着碧波万顷，景象万千        109.654555,18.236153   \n",
       "4316  39822     三亚湾   无  4.3  滨海大道依湾绵延，椰树成林构成一道画廊        109.451034,18.292751   \n",
       "5355  44824     鼓浪屿  5A  4.9              琴之岛，乐之屿        118.073486,24.452261   \n",
       "6863  52499     尖沙咀   无  4.5        这里可饱览维多利亚港的全景  114.174535177,22.300819397   \n",
       "\n",
       "                 所在地区  儿童旅客量   销售量     门票   省   市          区  \n",
       "2           上海·上海·松江区     55  4394  213.0  上海  上海        松江区  \n",
       "702         北京·北京·房山区     35     4   95.0  北京  北京        房山区  \n",
       "1931        安徽·黄山·黄山区     37  1410  240.0  安徽  黄山        黄山区  \n",
       "2592  广东·广州·广州长隆旅游度假区     38    10  214.0  广东  广州  广州长隆旅游度假区  \n",
       "4075        浙江·杭州·淳安县     90   804   35.0  浙江  杭州        淳安县  \n",
       "4096        浙江·杭州·西湖区     31    26   40.0  浙江  杭州        西湖区  \n",
       "4303            海南·三亚     40   288   90.0  海南  三亚        NaN  \n",
       "4316            海南·三亚     31   116   27.0  海南  三亚        NaN  \n",
       "5355        福建·厦门·思明区     30   614   25.0  福建  厦门        思明区  \n",
       "6863         香港·香港·九龙     31    33  167.0  香港  香港         九龙  "
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_new[(df_new['儿童旅客量']>=30)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "def lookup(price,star,province):\n",
    "    \"\"\"\n",
    "    lookup函数是根据景点门票、星级\n",
    "    \"\"\"\n",
    "    price = float(price)\n",
    "    result = df_new[(df_new['门票']==price)&(df_new['星级']==star)&(df_new['省']==province)]\n",
    "    result = result[['景点名称','星级','评分','介绍','所在地区','儿童旅客量','销售量','门票']].sort_values('销售量',ascending=False)\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6405</th>\n",
       "      <td>大风堡原始森林</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.5</td>\n",
       "      <td>大风起，风起云涌，林涛阵阵，山风呜呜</td>\n",
       "      <td>重庆·重庆·黄水国家森林公园</td>\n",
       "      <td>0</td>\n",
       "      <td>96</td>\n",
       "      <td>50.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         景点名称  星级   评分                  介绍            所在地区  儿童旅客量  销售量    门票\n",
       "6405  大风堡原始森林  4A  3.5  大风起，风起云涌，林涛阵阵，山风呜呜  重庆·重庆·黄水国家森林公园      0   96  50.0"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lookup('50','4A','重庆')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "ename": "ImportError",
     "evalue": "cannot import name 'Map' from 'pyecharts.charts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\charts\\__init__.py)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mImportError\u001b[0m                               Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-34-5596a2f9750f>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mMap\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0moptions\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mopts\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m \u001b[0mx_data\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdf_new\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'省'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtolist\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m \u001b[0my_data\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdf_new\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'销售量'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtoliBst\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mImportError\u001b[0m: cannot import name 'Map' from 'pyecharts.charts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\charts\\__init__.py)"
     ]
    }
   ],
   "source": [
    "from pyecharts.charts import Map\n",
    "\n",
    "from pyecharts import options as opts\n",
    "x_data = df_new['省'].tolist()\n",
    "y_data = df_new['销售量'].toliBst()\n",
    "\n",
    "m = Map()\n",
    "m.add('',[list(z) for z in zip(x_data,y_data)],maptype = 'china',is_map_symbol_show=False)\n",
    "m.set_series_opts(label_opts = opts.LabelOpts(is_show=True))\n",
    "m.set_global_opts(title_opts = opts.TitleOpts(title = '销售量',\n",
    "                                              subtitle = '此为全国常住人口的有关数据 \\n数据表明：广东省的常住人口数量最多，人口密度由黑河—腾冲线划分开，黑河—腾冲线以东占了全国96%的人口',),\n",
    "visualmap_opts = opts.VisualMapOpts(min_=df_new['销售量'].min(),max_=df_new['销售量'].max(),\n",
    "range_color=['#C2E7C0','#61BDCD','#0D6DAE']))\n",
    "m.render('销售量.html')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '上海',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '云南',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '内蒙古',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '北京',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " '台湾',\n",
       " ...]"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_new['省'].tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "ename": "ImportError",
     "evalue": "cannot import name 'options' from 'pyecharts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\__init__.py)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mImportError\u001b[0m                               Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-36-19f3300b063a>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0moptions\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mopts\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mGeo\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfaker\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mFaker\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m c = (\n",
      "\u001b[1;31mImportError\u001b[0m: cannot import name 'options' from 'pyecharts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\__init__.py)"
     ]
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Geo\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "c = (\n",
    "    Geo()\n",
    "    .add_schema(maptype=\"china\")\n",
    "    .add(\"geo\", [list(z) for z in zip(df_new['省'].tolist(), df_new['销售量'].toliBst())])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "    .set_global_opts(\n",
    "        visualmap_opts=opts.VisualMapOpts(), title_opts=opts.TitleOpts(title=\"Geo-基本示例\")\n",
    "    )\n",
    "    .render(\"geo_base.html\")\n",
    ")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "price_list = ['免费','50元以下',\n",
    "          '50-100元','100-200元','200-300元',\n",
    "          '300-500元','700-1000元','1000以上']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "def lookup(price,star,province):    \n",
    "    if province in province_list and price in price_list and star in star_list:\n",
    "            if price in price_list[0]:\n",
    "                result = df_new[(df_new['门票']==0.0)&(df_new['星级']==star)&(df_new['省']==province)]\n",
    "                result = result[['景点名称','星级','评分','介绍','所在地区','儿童旅客量','销售量','门票']] \\\n",
    "                .sort_values('销售量',ascending=False)\n",
    "            elif price in price_list[1]:\n",
    "                result = df_new[(df_new['门票']<=50.0)&(df_new['星级']==star)&(df_new['省']==province)]\n",
    "                result = result[['景点名称','星级','评分','介绍','所在地区','儿童旅客量','销售量','门票']] \\\n",
    "                .sort_values('销售量',ascending=False)\n",
    "            elif price in price_list[2]:\n",
    "                result = df_new[(df_new['门票']>50.0)&(df_new['门票']<=100.0)&(df_new['星级']==star) \\\n",
    "                &(df_new['省']==province)]\n",
    "                result = result[['景点名称','星级','评分','介绍','所在地区','儿童旅客量','销售量','门票']] \\\n",
    "                .sort_values('销售量',ascending=False)                \n",
    "            elif price in price_list[3]:\n",
    "                result = df_new[(df_new['门票']>100.0)&(df_new['门票']<=200.0)&(df_new['星级']==star) \\\n",
    "                &(df_new['省']==province)]\n",
    "                result = result[['景点名称','星级','评分','介绍','所在地区','儿童旅客量','销售量','门票']] \\\n",
    "                .sort_values('销售量',ascending=False)                \n",
    "            elif price in price_list[4]:\n",
    "                result = df_new[(df_new['门票']>200.0)&(df_new['门票']<=300.0)&(df_new['星级']==star) \\\n",
    "                &(df_new['省']==province)]\n",
    "                result = result[['景点名称','星级','评分','介绍','所在地区','儿童旅客量','销售量','门票']] \\\n",
    "                .sort_values('销售量',ascending=False) \n",
    "            elif price in price_list[5]:\n",
    "                result = df_new[(df_new['门票']>300.0)&(df_new['门票']<=500.0)&(df_new['星级']==star) \\\n",
    "                &(df_new['省']==province)]\n",
    "                result = result[['景点名称','星级','评分','介绍','所在地区','儿童旅客量','销售量','门票']] \\\n",
    "                .sort_values('销售量',ascending=False)\n",
    "            elif price in price_list[6]:\n",
    "                result = df_new[(df_new['门票']>500.0)&(df_new['门票']<=700.0)&(df_new['星级']==star) \\\n",
    "                &(df_new['省']==province)]\n",
    "                result = result[['景点名称','星级','评分','介绍','所在地区','儿童旅客量','销售量','门票']] \\\n",
    "                .sort_values('销售量',ascending=False)\n",
    "            elif price in price_list[7]:\n",
    "                result = df_new[(df_new['门票']>700.0)&(df_new['门票']<=1000.0)&(df_new['星级']==star) \\\n",
    "                &(df_new['省']==province)]\n",
    "                result = result[['景点名称','星级','评分','介绍','所在地区','儿童旅客量','销售量','门票']] \\\n",
    "                .sort_values('销售量',ascending=False)\n",
    "            else:\n",
    "                result = df_new[(df_new['门票']>1000.0)&(df_new['星级']==star)&(df_new['省']==province)]\n",
    "                result = result[['景点名称','星级','评分','介绍','所在地区','儿童旅客量','销售量','门票']] \\\n",
    "                .sort_values('销售量',ascending=False)                                                                \n",
    "\n",
    "    else:\n",
    "        print('查询无效，请重新选择3个指标！') \n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6384</th>\n",
       "      <td>万寿古寨景区</td>\n",
       "      <td>3A</td>\n",
       "      <td>0.0</td>\n",
       "      <td>石柱万寿古寨，国家AAA级旅游景区，位于万寿山脚下，是石柱土家族非物质文化保护传承基地，是自...</td>\n",
       "      <td>重庆·重庆·石柱县</td>\n",
       "      <td>0</td>\n",
       "      <td>69</td>\n",
       "      <td>25.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6301</th>\n",
       "      <td>文峰古街</td>\n",
       "      <td>3A</td>\n",
       "      <td>0.0</td>\n",
       "      <td>国家3A风景名胜区</td>\n",
       "      <td>重庆·重庆</td>\n",
       "      <td>0</td>\n",
       "      <td>68</td>\n",
       "      <td>18.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6330</th>\n",
       "      <td>滑石古寨景区</td>\n",
       "      <td>3A</td>\n",
       "      <td>0.0</td>\n",
       "      <td>饱享青山绿水眼福，观赏奇寨怪石风光</td>\n",
       "      <td>重庆·重庆·梁平县</td>\n",
       "      <td>0</td>\n",
       "      <td>55</td>\n",
       "      <td>35.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6400</th>\n",
       "      <td>金色蛋糕梦幻王国</td>\n",
       "      <td>3A</td>\n",
       "      <td>0.0</td>\n",
       "      <td>开启儿童聪明的官能</td>\n",
       "      <td>重庆·重庆·大渡口区</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>45.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6371</th>\n",
       "      <td>重庆鳄鱼中心</td>\n",
       "      <td>3A</td>\n",
       "      <td>0.0</td>\n",
       "      <td>绿树成荫，鸟语花香，曲径通幽，布局紧奏</td>\n",
       "      <td>重庆·重庆·渝北区</td>\n",
       "      <td>0</td>\n",
       "      <td>14</td>\n",
       "      <td>45.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6302</th>\n",
       "      <td>双桂堂</td>\n",
       "      <td>3A</td>\n",
       "      <td>3.5</td>\n",
       "      <td>中国及东南亚具有重要地位的佛教圣地</td>\n",
       "      <td>重庆·重庆·梁平县</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          景点名称  星级   评分                                                 介绍  \\\n",
       "6384    万寿古寨景区  3A  0.0  石柱万寿古寨，国家AAA级旅游景区，位于万寿山脚下，是石柱土家族非物质文化保护传承基地，是自...   \n",
       "6301      文峰古街  3A  0.0                                          国家3A风景名胜区   \n",
       "6330    滑石古寨景区  3A  0.0                                  饱享青山绿水眼福，观赏奇寨怪石风光   \n",
       "6400  金色蛋糕梦幻王国  3A  0.0                                          开启儿童聪明的官能   \n",
       "6371    重庆鳄鱼中心  3A  0.0                                绿树成荫，鸟语花香，曲径通幽，布局紧奏   \n",
       "6302       双桂堂  3A  3.5                                  中国及东南亚具有重要地位的佛教圣地   \n",
       "\n",
       "            所在地区  儿童旅客量  销售量    门票  \n",
       "6384   重庆·重庆·石柱县      0   69  25.0  \n",
       "6301       重庆·重庆      0   68  18.0  \n",
       "6330   重庆·重庆·梁平县      0   55  35.8  \n",
       "6400  重庆·重庆·大渡口区      0   40  45.0  \n",
       "6371   重庆·重庆·渝北区      0   14  45.0  \n",
       "6302   重庆·重庆·梁平县      0    2   2.0  "
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lookup('50元以下','3A','重庆')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "      <th>省</th>\n",
       "      <th>市</th>\n",
       "      <th>区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>上海欢乐谷</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>游乐项目惊险刺激，特色表演异彩纷呈</td>\n",
       "      <td>121.22218,31.102491</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>55</td>\n",
       "      <td>4394</td>\n",
       "      <td>213.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>松江区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>上海海昌海洋公园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>感受海洋公园乐趣</td>\n",
       "      <td>121.915647,30.917713</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>18</td>\n",
       "      <td>4094</td>\n",
       "      <td>178.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>上海野生动物园</td>\n",
       "      <td>5A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>与野生动物近距离的“亲密接触”</td>\n",
       "      <td>121.728112,31.059636</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>2667</td>\n",
       "      <td>17.1</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>8</td>\n",
       "      <td>浦江郊野公园奇迹花园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>来奇迹花园开启一段花之奇旅吧</td>\n",
       "      <td>121.509672,31.060409</td>\n",
       "      <td>上海·上海·闵行区</td>\n",
       "      <td>0</td>\n",
       "      <td>1074</td>\n",
       "      <td>49.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>闵行区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>27</td>\n",
       "      <td>上海周浦花海</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>一年四季鲜花不断，汇成令人迷醉的花海</td>\n",
       "      <td>121.65535,31.118973</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>826</td>\n",
       "      <td>39.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159</th>\n",
       "      <td>159</td>\n",
       "      <td>上海海洋水族馆</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.7</td>\n",
       "      <td>穿越世界，来一次终生难忘的海洋之旅</td>\n",
       "      <td>121.50818,31.246234</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>158</th>\n",
       "      <td>158</td>\n",
       "      <td>东方明珠一日游</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>全方位的展现上海风貌</td>\n",
       "      <td>121.506377,31.245105</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>157</th>\n",
       "      <td>157</td>\n",
       "      <td>3D魔幻趣味馆</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>你就是画中主角</td>\n",
       "      <td>121.50356,31.244489</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>156</th>\n",
       "      <td>156</td>\n",
       "      <td>上海巧克力开心乐园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>一个由巧克力搭建的开心集结地</td>\n",
       "      <td>121.48176,31.187927</td>\n",
       "      <td>上海·上海·上海世博园</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海世博园</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>214</th>\n",
       "      <td>224</td>\n",
       "      <td>环球奇趣体验馆</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>一馆玩遍世界超新奇趣体验</td>\n",
       "      <td>121.497752,31.232364</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>黄浦区</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>215 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     index        景点名称  星级   评分                  介绍                   经纬度  \\\n",
       "2        2       上海欢乐谷  4A  3.6   游乐项目惊险刺激，特色表演异彩纷呈   121.22218,31.102491   \n",
       "3        3    上海海昌海洋公园   无  0.0            感受海洋公园乐趣  121.915647,30.917713   \n",
       "1        1     上海野生动物园  5A  3.6     与野生动物近距离的“亲密接触”  121.728112,31.059636   \n",
       "8        8  浦江郊野公园奇迹花园   无  0.0      来奇迹花园开启一段花之奇旅吧  121.509672,31.060409   \n",
       "27      27      上海周浦花海   无  0.0  一年四季鲜花不断，汇成令人迷醉的花海   121.65535,31.118973   \n",
       "..     ...         ...  ..  ...                 ...                   ...   \n",
       "159    159     上海海洋水族馆  4A  3.7   穿越世界，来一次终生难忘的海洋之旅   121.50818,31.246234   \n",
       "158    158     东方明珠一日游   无  0.0          全方位的展现上海风貌  121.506377,31.245105   \n",
       "157    157     3D魔幻趣味馆   无  0.0             你就是画中主角   121.50356,31.244489   \n",
       "156    156   上海巧克力开心乐园   无  0.0      一个由巧克力搭建的开心集结地   121.48176,31.187927   \n",
       "214    224     环球奇趣体验馆   无  0.0        一馆玩遍世界超新奇趣体验  121.497752,31.232364   \n",
       "\n",
       "            所在地区  儿童旅客量   销售量     门票   省   市      区  \n",
       "2      上海·上海·松江区     55  4394  213.0  上海  上海    松江区  \n",
       "3     上海·上海·浦东新区     18  4094  178.0  上海  上海   浦东新区  \n",
       "1     上海·上海·浦东新区      0  2667   17.1  上海  上海   浦东新区  \n",
       "8      上海·上海·闵行区      0  1074   49.0  上海  上海    闵行区  \n",
       "27    上海·上海·浦东新区      0   826   39.0  上海  上海   浦东新区  \n",
       "..           ...    ...   ...    ...  ..  ..    ...  \n",
       "159   上海·上海·浦东新区      0     0    0.0  上海  上海   浦东新区  \n",
       "158   上海·上海·浦东新区      0     0    0.0  上海  上海   浦东新区  \n",
       "157   上海·上海·浦东新区      0     0    0.0  上海  上海   浦东新区  \n",
       "156  上海·上海·上海世博园      0     0    0.0  上海  上海  上海世博园  \n",
       "214    上海·上海·黄浦区      0     0    0.0  上海  上海    黄浦区  \n",
       "\n",
       "[215 rows x 13 columns]"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_new[(df_new['省']=='上海')].sort_values('销售量',ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: echarts-china-provinces-pypkg in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (0.0.3)\n",
      "Requirement already satisfied: lml>=0.0.2 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from echarts-china-provinces-pypkg) (0.0.2)\n",
      "Requirement already satisfied: pyecharts-jupyter-installer==0.0.3 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from echarts-china-provinces-pypkg) (0.0.3)\n",
      "Requirement already satisfied: echarts-china-cities-pypkg in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (0.0.9)\n",
      "Requirement already satisfied: pyecharts-jupyter-installer==0.0.3 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from echarts-china-cities-pypkg) (0.0.3)\n",
      "Requirement already satisfied: lml>=0.0.2 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from echarts-china-cities-pypkg) (0.0.2)\n",
      "Requirement already satisfied: echarts-china-counties-pypkg in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (0.0.2)\n",
      "Requirement already satisfied: lml==0.0.2 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from echarts-china-counties-pypkg) (0.0.2)\n",
      "Requirement already satisfied: pyecharts-jupyter-installer==0.0.3 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from echarts-china-counties-pypkg) (0.0.3)\n",
      "Requirement already satisfied: echarts-china-misc-pypkg in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (0.0.1)\n",
      "Requirement already satisfied: pyecharts-jupyter-installer==0.0.3 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from echarts-china-misc-pypkg) (0.0.3)\n",
      "Requirement already satisfied: lml==0.0.2 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from echarts-china-misc-pypkg) (0.0.2)\n"
     ]
    }
   ],
   "source": [
    "# 画图模块的安装\n",
    "# ! pip install echarts-countries-pypkg\n",
    "! pip install echarts-china-provinces-pypkg\n",
    "! pip install echarts-china-cities-pypkg\n",
    "! pip install echarts-china-counties-pypkg\n",
    "! pip install echarts-china-misc-pypkg"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: echarts-countries-pypkg in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (0.1.6)\n",
      "Requirement already satisfied: lml>=0.0.2 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from echarts-countries-pypkg) (0.0.2)\n",
      "Requirement already satisfied: pyecharts-jupyter-installer==0.0.3 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from echarts-countries-pypkg) (0.0.3)\n"
     ]
    }
   ],
   "source": [
    "! pip install echarts-countries-pypkg"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>省</th>\n",
       "      <th>景点门票销售量</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>四川</td>\n",
       "      <td>56055</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>广东</td>\n",
       "      <td>30669</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>北京</td>\n",
       "      <td>27636</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>海南</td>\n",
       "      <td>27515</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>江苏</td>\n",
       "      <td>25700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>上海</td>\n",
       "      <td>23670</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>贵州</td>\n",
       "      <td>23154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>安徽</td>\n",
       "      <td>21883</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>陕西</td>\n",
       "      <td>21737</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>江西</td>\n",
       "      <td>21094</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>湖南</td>\n",
       "      <td>20610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>云南</td>\n",
       "      <td>19142</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>山东</td>\n",
       "      <td>19042</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>浙江</td>\n",
       "      <td>18936</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>辽宁</td>\n",
       "      <td>18096</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>重庆</td>\n",
       "      <td>15916</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>福建</td>\n",
       "      <td>15510</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>河南</td>\n",
       "      <td>15118</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>广西</td>\n",
       "      <td>15092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>湖北</td>\n",
       "      <td>14158</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>山西</td>\n",
       "      <td>9648</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>河北</td>\n",
       "      <td>9088</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>甘肃</td>\n",
       "      <td>6602</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>天津</td>\n",
       "      <td>5860</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>内蒙古</td>\n",
       "      <td>5245</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>新疆</td>\n",
       "      <td>4692</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>吉林</td>\n",
       "      <td>4420</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>台湾</td>\n",
       "      <td>3955</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>澳门</td>\n",
       "      <td>3647</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>香港</td>\n",
       "      <td>3227</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>2838</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>西藏</td>\n",
       "      <td>2707</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>青海</td>\n",
       "      <td>2272</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>宁夏</td>\n",
       "      <td>2170</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      省  景点门票销售量\n",
       "6    四川    56055\n",
       "12   广东    30669\n",
       "3    北京    27636\n",
       "20   海南    27515\n",
       "15   江苏    25700\n",
       "0    上海    23670\n",
       "27   贵州    23154\n",
       "9    安徽    21883\n",
       "30   陕西    21737\n",
       "16   江西    21094\n",
       "22   湖南    20610\n",
       "1    云南    19142\n",
       "10   山东    19042\n",
       "19   浙江    18936\n",
       "28   辽宁    18096\n",
       "29   重庆    15916\n",
       "25   福建    15510\n",
       "18   河南    15118\n",
       "13   广西    15092\n",
       "21   湖北    14158\n",
       "11   山西     9648\n",
       "17   河北     9088\n",
       "24   甘肃     6602\n",
       "7    天津     5860\n",
       "2   内蒙古     5245\n",
       "14   新疆     4692\n",
       "5    吉林     4420\n",
       "4    台湾     3955\n",
       "23   澳门     3647\n",
       "32   香港     3227\n",
       "33  黑龙江     2838\n",
       "26   西藏     2707\n",
       "31   青海     2272\n",
       "8    宁夏     2170"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pivot_table = df_new.groupby(['省']).agg({\"销售量\":[\"sum\"]}).reset_index()\n",
    "s = pivot_table['省'].tolist()\n",
    "x = pivot_table['销售量']['sum'].tolist()\n",
    "xs = dict(zip(s,x))\n",
    "df3 = pd.DataFrame([xs]).T.reset_index().rename(columns={'index':'省',0:'景点门票销售量'}).sort_values('景点门票销售量',ascending=False)\n",
    "df3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 绘制各省景点门票销售量-热力图（地图）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "ename": "ImportError",
     "evalue": "cannot import name 'Bar' from 'pyecharts.charts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\charts\\__init__.py)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mImportError\u001b[0m                               Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-46-c4536d7ce219>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mBar\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mGeo\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mMap\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mImportError\u001b[0m: cannot import name 'Bar' from 'pyecharts.charts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\charts\\__init__.py)"
     ]
    }
   ],
   "source": [
    "from pyecharts.charts import Bar\n",
    "from pyecharts.charts import Geo\n",
    "from pyecharts.charts import Map"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'pyecharts.globals'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-47-7c5b61af53f9>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mglobals\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mChartType\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mSymbolType\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'pyecharts.globals'"
     ]
    }
   ],
   "source": [
    "from pyecharts.globals import ChartType, SymbolType"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'Geo' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-48-092aeb2eb5a3>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m c = (\n\u001b[1;32m----> 2\u001b[1;33m     \u001b[0mGeo\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      3\u001b[0m     \u001b[1;33m.\u001b[0m\u001b[0madd_schema\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mmaptype\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m\"china\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m     \u001b[1;33m.\u001b[0m\u001b[0madd\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"geo\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mlist\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mz\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mz\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mzip\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mtype_\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mChartType\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mHEATMAP\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m     \u001b[1;33m.\u001b[0m\u001b[0mset_series_opts\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlabel_opts\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mopts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mLabelOpts\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mis_show\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'Geo' is not defined"
     ]
    }
   ],
   "source": [
    "c = (\n",
    "    Geo()\n",
    "    .add_schema(maptype=\"china\")\n",
    "    .add(\"geo\", [list(z) for z in zip(s,x)],type_=ChartType.HEATMAP)\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "    .set_global_opts(\n",
    "        visualmap_opts=opts.VisualMapOpts(),\n",
    "        title_opts=opts.TitleOpts(title=\"各省景点门票销售量热力图\"),\n",
    "    )\n",
    ")\n",
    "\n",
    "c.render(\"test.html\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 绘制各省景点门票销售量-条形图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'of' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-49-acbf75d6aa64>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m     13\u001b[0m     \u001b[0myaxis_title\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0myaxis_title\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     14\u001b[0m )\n\u001b[1;32m---> 15\u001b[1;33m \u001b[0mof\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mplot\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfig\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m: name 'of' is not defined"
     ]
    }
   ],
   "source": [
    "x=df3['省'].tolist()\n",
    "y=df3['景点门票销售量'].tolist()\n",
    "text = df3['景点门票销售量']\n",
    "title=\"各省景点门票销售量\"\n",
    "xaxis_title = \"省份\"\n",
    "yaxis_title = \"数量\"\n",
    "bar1 = go.Bar(y=y, x=x,\n",
    "              text = text, textposition = 'outside', name='Auckland')# textpositon 是将text数据显示在条形柱上， outside是外面， inside是里面 ；name 和上述Scatter一样\n",
    "fig = go.Figure(bar1)\n",
    "fig.update_layout(\n",
    "    title = title,\n",
    "    xaxis_title = xaxis_title,\n",
    "    yaxis_title = yaxis_title,\n",
    ")\n",
    "of.plot(fig)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 各省景点等级数量对比"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 以省份、景点星级为分类，计算每个省份的对应景点类型数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>省</th>\n",
       "      <th>景点名称</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>上海</td>\n",
       "      <td>215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>云南</td>\n",
       "      <td>215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>内蒙古</td>\n",
       "      <td>215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>北京</td>\n",
       "      <td>214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>台湾</td>\n",
       "      <td>215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>吉林</td>\n",
       "      <td>214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>四川</td>\n",
       "      <td>215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>天津</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>宁夏</td>\n",
       "      <td>213</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>安徽</td>\n",
       "      <td>214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>山东</td>\n",
       "      <td>215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>山西</td>\n",
       "      <td>213</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>广东</td>\n",
       "      <td>227</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>广西</td>\n",
       "      <td>214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>新疆</td>\n",
       "      <td>214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>江苏</td>\n",
       "      <td>215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>江西</td>\n",
       "      <td>215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>河北</td>\n",
       "      <td>214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>河南</td>\n",
       "      <td>214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>浙江</td>\n",
       "      <td>215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>海南</td>\n",
       "      <td>212</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>湖北</td>\n",
       "      <td>212</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>湖南</td>\n",
       "      <td>213</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>澳门</td>\n",
       "      <td>206</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>甘肃</td>\n",
       "      <td>213</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>福建</td>\n",
       "      <td>214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>西藏</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>贵州</td>\n",
       "      <td>215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>辽宁</td>\n",
       "      <td>213</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>重庆</td>\n",
       "      <td>214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>陕西</td>\n",
       "      <td>215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>青海</td>\n",
       "      <td>212</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>香港</td>\n",
       "      <td>207</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>213</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      省  景点名称\n",
       "        count\n",
       "0    上海   215\n",
       "1    云南   215\n",
       "2   内蒙古   215\n",
       "3    北京   214\n",
       "4    台湾   215\n",
       "5    吉林   214\n",
       "6    四川   215\n",
       "7    天津   216\n",
       "8    宁夏   213\n",
       "9    安徽   214\n",
       "10   山东   215\n",
       "11   山西   213\n",
       "12   广东   227\n",
       "13   广西   214\n",
       "14   新疆   214\n",
       "15   江苏   215\n",
       "16   江西   215\n",
       "17   河北   214\n",
       "18   河南   214\n",
       "19   浙江   215\n",
       "20   海南   212\n",
       "21   湖北   212\n",
       "22   湖南   213\n",
       "23   澳门   206\n",
       "24   甘肃   213\n",
       "25   福建   214\n",
       "26   西藏   216\n",
       "27   贵州   215\n",
       "28   辽宁   213\n",
       "29   重庆   214\n",
       "30   陕西   215\n",
       "31   青海   212\n",
       "32   香港   207\n",
       "33  黑龙江   213"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_new.groupby(['省']).agg({\"景点名称\":[\"count\"]}).reset_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>省</th>\n",
       "      <th>景点名称</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>上海</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>云南</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>内蒙古</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>北京</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>吉林</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>四川</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>天津</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>宁夏</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>安徽</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>山东</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>山西</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>广东</td>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>广西</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>新疆</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>江苏</td>\n",
       "      <td>39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>江西</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>河北</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>河南</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>浙江</td>\n",
       "      <td>25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>海南</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>湖北</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>湖南</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>甘肃</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>福建</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>西藏</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>贵州</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>辽宁</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>重庆</td>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>陕西</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>青海</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      省  景点名称\n",
       "        count\n",
       "0    上海     3\n",
       "1    云南     9\n",
       "2   内蒙古    10\n",
       "3    北京    10\n",
       "4    吉林     8\n",
       "5    四川    12\n",
       "6    天津     2\n",
       "7    宁夏     4\n",
       "8    安徽    17\n",
       "9    山东    18\n",
       "10   山西     9\n",
       "11   广东    13\n",
       "12   广西    10\n",
       "13   新疆    14\n",
       "14   江苏    39\n",
       "15   江西    12\n",
       "16   河北    12\n",
       "17   河南    19\n",
       "18   浙江    25\n",
       "19   海南     6\n",
       "20   湖北    17\n",
       "21   湖南    12\n",
       "22   甘肃     4\n",
       "23   福建     9\n",
       "24   西藏     4\n",
       "25   贵州     6\n",
       "26   辽宁     6\n",
       "27   重庆    13\n",
       "28   陕西    11\n",
       "29   青海     6\n",
       "30  黑龙江     5"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pivot_5A = df_new[df_new.星级.str.contains('5A')].groupby(['省']).agg({\"景点名称\":[\"count\"]}).reset_index()\n",
    "pivot_4A = df_new[df_new.星级.str.contains('4A')].groupby(['省']).agg({\"景点名称\":[\"count\"]}).reset_index()\n",
    "pivot_3A = df_new[df_new.星级.str.contains('3A')].groupby(['省']).agg({\"景点名称\":[\"count\"]}).reset_index()\n",
    "pivot_无 = df_new[df_new.星级.str.contains('无')].groupby(['省']).agg({\"景点名称\":[\"count\"]}).reset_index()\n",
    "pivot_5A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'上海': 3,\n",
       " '云南': 9,\n",
       " '内蒙古': 10,\n",
       " '北京': 10,\n",
       " '台湾': 0,\n",
       " '吉林': 8,\n",
       " '四川': 12,\n",
       " '天津': 2,\n",
       " '宁夏': 4,\n",
       " '安徽': 17,\n",
       " '山东': 18,\n",
       " '山西': 9,\n",
       " '广东': 13,\n",
       " '广西': 10,\n",
       " '新疆': 14,\n",
       " '江苏': 39,\n",
       " '江西': 12,\n",
       " '河北': 12,\n",
       " '河南': 19,\n",
       " '浙江': 25,\n",
       " '海南': 6,\n",
       " '湖北': 17,\n",
       " '湖南': 12,\n",
       " '澳门': 0,\n",
       " '甘肃': 4,\n",
       " '福建': 9,\n",
       " '西藏': 4,\n",
       " '贵州': 6,\n",
       " '辽宁': 6,\n",
       " '重庆': 13,\n",
       " '陕西': 11,\n",
       " '香港': 0,\n",
       " '青海': 6,\n",
       " '黑龙江': 5}"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a=pivot_5A['省'].tolist()\n",
    "a.insert(22,'澳门')\n",
    "a.insert(-2,'香港')\n",
    "a.insert(4,'台湾')\n",
    "b=pivot_5A['景点名称']['count'].tolist()\n",
    "b.insert(22,0)\n",
    "b.insert(-2,0)\n",
    "b.insert(4,0)\n",
    "dict_5A = dict(zip(a,b))\n",
    "list(dict_5A.keys())\n",
    "dict_5A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'上海': 33,\n",
       " '云南': 48,\n",
       " '内蒙古': 47,\n",
       " '北京': 52,\n",
       " '台湾': 0,\n",
       " '吉林': 26,\n",
       " '四川': 61,\n",
       " '天津': 22,\n",
       " '宁夏': 16,\n",
       " '安徽': 65,\n",
       " '山东': 82,\n",
       " '山西': 59,\n",
       " '广东': 52,\n",
       " '广西': 65,\n",
       " '新疆': 34,\n",
       " '江苏': 50,\n",
       " '江西': 41,\n",
       " '河北': 66,\n",
       " '河南': 62,\n",
       " '浙江': 59,\n",
       " '海南': 18,\n",
       " '湖北': 57,\n",
       " '湖南': 36,\n",
       " '澳门': 0,\n",
       " '甘肃': 49,\n",
       " '福建': 34,\n",
       " '西藏': 6,\n",
       " '贵州': 28,\n",
       " '辽宁': 45,\n",
       " '重庆': 39,\n",
       " '陕西': 38,\n",
       " '香港': 0,\n",
       " '青海': 18,\n",
       " '黑龙江': 39}"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a1=pivot_4A['省'].tolist()\n",
    "a1.insert(22,'澳门')\n",
    "a1.insert(-2,'香港')\n",
    "a1.insert(4,'台湾')\n",
    "b1=pivot_4A['景点名称']['count'].tolist()\n",
    "b1.insert(22,0)\n",
    "b1.insert(-2,0)\n",
    "b1.insert(4,0)\n",
    "dict_4A = dict(zip(a1,b1))\n",
    "dict_4A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'上海': 8,\n",
       " '云南': 13,\n",
       " '内蒙古': 19,\n",
       " '北京': 28,\n",
       " '台湾': 0,\n",
       " '吉林': 19,\n",
       " '四川': 5,\n",
       " '天津': 12,\n",
       " '宁夏': 12,\n",
       " '安徽': 16,\n",
       " '山东': 20,\n",
       " '山西': 3,\n",
       " '广东': 6,\n",
       " '广西': 15,\n",
       " '新疆': 33,\n",
       " '江苏': 11,\n",
       " '江西': 6,\n",
       " '河北': 13,\n",
       " '河南': 12,\n",
       " '浙江': 11,\n",
       " '海南': 8,\n",
       " '湖北': 17,\n",
       " '湖南': 12,\n",
       " '澳门': 1,\n",
       " '甘肃': 11,\n",
       " '福建': 10,\n",
       " '西藏': 10,\n",
       " '贵州': 14,\n",
       " '辽宁': 14,\n",
       " '重庆': 10,\n",
       " '陕西': 19,\n",
       " '香港': 0,\n",
       " '青海': 31,\n",
       " '黑龙江': 35}"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a2=pivot_3A['省'].tolist()\n",
    "a2.insert(-2,'香港')\n",
    "a2.insert(4,'台湾')\n",
    "b2=pivot_3A['景点名称']['count'].tolist()\n",
    "b2.insert(-2,0)\n",
    "b2.insert(4,0)\n",
    "dict_3A = dict(zip(a2,b2))\n",
    "dict_3A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'上海': 171,\n",
       " '云南': 145,\n",
       " '内蒙古': 139,\n",
       " '北京': 124,\n",
       " '台湾': 215,\n",
       " '吉林': 161,\n",
       " '四川': 137,\n",
       " '天津': 180,\n",
       " '宁夏': 181,\n",
       " '安徽': 116,\n",
       " '山东': 95,\n",
       " '山西': 142,\n",
       " '广东': 156,\n",
       " '广西': 124,\n",
       " '新疆': 133,\n",
       " '江苏': 115,\n",
       " '江西': 156,\n",
       " '河北': 123,\n",
       " '河南': 121,\n",
       " '浙江': 120,\n",
       " '海南': 180,\n",
       " '湖北': 121,\n",
       " '湖南': 153,\n",
       " '澳门': 205,\n",
       " '甘肃': 149,\n",
       " '福建': 161,\n",
       " '西藏': 196,\n",
       " '贵州': 167,\n",
       " '辽宁': 148,\n",
       " '重庆': 152,\n",
       " '陕西': 147,\n",
       " '青海': 157,\n",
       " '香港': 207,\n",
       " '黑龙江': 134}"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dict_无 = dict(zip(pivot_无['省'],pivot_无['景点名称']['count']))\n",
    "dict_无"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 绘制各省景点等级数量对比-堆叠图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'py' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-56-01ea8dd09205>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mpyplt\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0moffline\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mplot\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m trace1 = go.Bar(\n\u001b[0;32m      3\u001b[0m  \u001b[0my\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m  \u001b[0mx\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mlist\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdict_5A\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m  \u001b[0mname\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;34m'5A景点'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'py' is not defined"
     ]
    }
   ],
   "source": [
    "pyplt = py.offline.plot\n",
    "trace1 = go.Bar(\n",
    " y = a,\n",
    " x = list(dict_5A.values()),\n",
    " name = '5A景点',\n",
    " orientation = 'h',\n",
    " marker = dict(\n",
    " color = '#FF7744',\n",
    " line = dict(\n",
    "  color = '#FF7744',\n",
    "  width = 3)\n",
    " )\n",
    ")\n",
    "trace2 = go.Bar(\n",
    " y = a,\n",
    " x = list(dict_4A.values()),\n",
    " name = '4A景点',\n",
    " orientation = 'h',\n",
    " marker = dict(\n",
    " color = '#FFFF33',\n",
    " line = dict(\n",
    "  color = '#FFFF33',\n",
    "  width = 3)\n",
    " )\n",
    ")\n",
    "trace3 = go.Bar(\n",
    " y = a,\n",
    " x = list(dict_3A.values()),\n",
    " name = '3A景点',\n",
    " orientation = 'h',\n",
    " marker = dict(\n",
    " color = '#99FF33',\n",
    " line = dict(\n",
    "  color = '#99FF33',\n",
    "  width = 3)\n",
    " )\n",
    ")\n",
    "trace4 = go.Bar(\n",
    " y = a,\n",
    " x = list(dict_无.values()),\n",
    " name = '普通景点',\n",
    " orientation = 'h',\n",
    " marker = dict(\n",
    " color = '#33CCFF',\n",
    " line = dict(\n",
    "  color = '#33CCFF',\n",
    "  width = 3)\n",
    " )\n",
    ")\n",
    "  \n",
    "data = [trace1, trace2,trace3,trace4]\n",
    "layout = go.Layout(\n",
    " title = '各省景点等级数量对比',\n",
    " barmode='stack'\n",
    ")\n",
    "  \n",
    "fig = go.Figure(data=data, layout=layout)\n",
    "pyplt(fig, filename='各省景点等级数量对比.html')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## （新）根据地区划分 对比景点等级数量  \n",
    "1.华北地区：北京、天津、河北、山西、内蒙古  \n",
    "2.华东地区：上海、江苏、浙江，山东、安徽、江西、福建  \n",
    "3.东北地区：辽宁、吉林、黑龙江  \n",
    "4.华中地区：湖、湖南、河南  \n",
    "5.华南地区：广东、广西、海南  \n",
    "6.西南地区：四川、重庆、贵州、云南、西藏  \n",
    "7.西北地区：陕西、甘肃、新疆、青海、宁夏  \n",
    "8.港澳台地区：香港、澳门、台湾 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [],
   "source": [
    "华北地区 = ['北京','天津','河北','山西','内蒙古']\n",
    "华东地区 = ['上海','江苏','浙江','山东','安徽','江西','福建']\n",
    "华南地区 = ['广东','广西','海南']\n",
    "华中地区 = ['湖北','湖南','河南']\n",
    "西南地区 = ['四川','重庆','贵州','云南','西藏']\n",
    "西北地区 = ['陕西','甘肃','新疆','青海','宁夏']\n",
    "东北地区 = ['辽宁','吉林','黑龙江']\n",
    "港澳台地区 = ['香港','澳门','台湾']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'内蒙古': 19, '北京': 28, '天津': 12, '山西': 3, '河北': 13}"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "华北地区_5A_dict = { k: v for k, v in dict_5A.items() if k=='北京' or k=='天津'  or k=='河北' or k=='山西' or k=='内蒙古'}\n",
    "华北地区_4A_dict = { k: v for k, v in dict_4A.items() if k=='北京' or k=='天津'  or k=='河北' or k=='山西' or k=='内蒙古'}\n",
    "华北地区_3A_dict = { k: v for k, v in dict_3A.items() if k=='北京' or k=='天津'  or k=='河北' or k=='山西' or k=='内蒙古'}\n",
    "华北地区_无_dict = { k: v for k, v in dict_无.items() if k=='北京' or k=='天津'  or k=='河北' or k=='山西' or k=='内蒙古'}\n",
    "华北地区_3A_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'广东': 52, '广西': 65, '海南': 18}"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "华南地区_5A_dict = { k: v for k, v in dict_5A.items() if k=='广东' or k=='广西'  or k=='海南'}\n",
    "华南地区_4A_dict = { k: v for k, v in dict_4A.items() if k=='广东' or k=='广西'  or k=='海南'}\n",
    "华南地区_3A_dict = { k: v for k, v in dict_3A.items() if k=='广东' or k=='广西'  or k=='海南'}\n",
    "华南地区_无_dict = { k: v for k, v in dict_无.items() if k=='广东' or k=='广西'  or k=='海南'}\n",
    "华南地区_4A_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'上海': 171, '安徽': 116, '山东': 95, '江苏': 115, '江西': 156, '浙江': 120, '福建': 161}"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "华东地区_5A_dict = { k: v for k, v in dict_5A.items() if k=='上海' or k=='江苏'  or k=='浙江' or k=='山东' or k=='安徽' or k=='江西' or k=='福建'}\n",
    "华东地区_4A_dict = { k: v for k, v in dict_4A.items() if k=='上海' or k=='江苏'  or k=='浙江' or k=='山东' or k=='安徽' or k=='江西' or k=='福建'}\n",
    "华东地区_3A_dict = { k: v for k, v in dict_3A.items() if k=='上海' or k=='江苏'  or k=='浙江' or k=='山东' or k=='安徽' or k=='江西' or k=='福建'}\n",
    "华东地区_无_dict = { k: v for k, v in dict_无.items() if k=='上海' or k=='江苏'  or k=='浙江' or k=='山东' or k=='安徽' or k=='江西' or k=='福建'}\n",
    "华东地区_无_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'河南': 121, '湖北': 121, '湖南': 153}"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "华中地区_5A_dict = { k: v for k, v in dict_5A.items() if k=='湖北' or k=='湖南'  or k=='河南'}\n",
    "华中地区_4A_dict = { k: v for k, v in dict_4A.items() if k=='湖北' or k=='湖南'  or k=='河南'}\n",
    "华中地区_3A_dict = { k: v for k, v in dict_3A.items() if k=='湖北' or k=='湖南'  or k=='河南'}\n",
    "华中地区_无_dict = { k: v for k, v in dict_无.items() if k=='湖北' or k=='湖南'  or k=='河南'}\n",
    "华中地区_无_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'云南': 145, '四川': 137, '西藏': 196, '贵州': 167, '重庆': 152}"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "西南地区_5A_dict = { k: v for k, v in dict_5A.items() if k=='四川' or k=='重庆'  or k=='贵州' or k=='云南' or k=='西藏'}\n",
    "西南地区_4A_dict = { k: v for k, v in dict_4A.items() if k=='四川' or k=='重庆'  or k=='贵州' or k=='云南' or k=='西藏'}\n",
    "西南地区_3A_dict = { k: v for k, v in dict_3A.items() if k=='四川' or k=='重庆'  or k=='贵州' or k=='云南' or k=='西藏'}\n",
    "西南地区_无_dict = { k: v for k, v in dict_无.items() if k=='四川' or k=='重庆'  or k=='贵州' or k=='云南' or k=='西藏'}\n",
    "西南地区_无_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'宁夏': 181, '新疆': 133, '甘肃': 149, '陕西': 147, '青海': 157}"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "西北地区_5A_dict = { k: v for k, v in dict_5A.items() if k=='陕西' or k=='甘肃'  or k=='新疆' or k=='青海' or k=='宁夏'}\n",
    "西北地区_4A_dict = { k: v for k, v in dict_4A.items() if k=='陕西' or k=='甘肃'  or k=='新疆' or k=='青海' or k=='宁夏'}\n",
    "西北地区_3A_dict = { k: v for k, v in dict_3A.items() if k=='陕西' or k=='甘肃'  or k=='新疆' or k=='青海' or k=='宁夏'}\n",
    "西北地区_无_dict = { k: v for k, v in dict_无.items() if k=='陕西' or k=='甘肃'  or k=='新疆' or k=='青海' or k=='宁夏'}\n",
    "西北地区_无_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'吉林': 161, '辽宁': 148, '黑龙江': 134}"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "东北地区_5A_dict = { k: v for k, v in dict_5A.items() if k=='辽宁' or k=='吉林'  or k=='黑龙江'}\n",
    "东北地区_4A_dict = { k: v for k, v in dict_4A.items() if k=='辽宁' or k=='吉林'  or k=='黑龙江'}\n",
    "东北地区_3A_dict = { k: v for k, v in dict_3A.items() if k=='辽宁' or k=='吉林'  or k=='黑龙江'}\n",
    "东北地区_无_dict = { k: v for k, v in dict_无.items() if k=='辽宁' or k=='吉林'  or k=='黑龙江'}\n",
    "东北地区_无_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'台湾': 215, '澳门': 205, '香港': 207}"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "港澳台地区_5A_dict = { k: v for k, v in dict_5A.items() if k=='香港' or k=='澳门'  or k=='台湾'}\n",
    "港澳台地区_4A_dict = { k: v for k, v in dict_4A.items() if k=='香港' or k=='澳门'  or k=='台湾'}\n",
    "港澳台地区_3A_dict = { k: v for k, v in dict_3A.items() if k=='香港' or k=='澳门'  or k=='台湾'}\n",
    "港澳台地区_无_dict = { k: v for k, v in dict_无.items() if k=='香港' or k=='澳门'  or k=='台湾'}\n",
    "港澳台地区_无_dict "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 绘制对比图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 华北地区\n",
    "star_list = ['5A', '4A','3A', '普通']\n",
    "天津 = [2,22,12,180]\n",
    "北京 = [10,52,28,124]\n",
    "河北 = [12,66,13,123]\n",
    "山西 = [9,59,3,142]\n",
    "内蒙古 = [10,47,19,139]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "ename": "ImportError",
     "evalue": "cannot import name 'Bar' from 'pyecharts.charts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\charts\\__init__.py)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mImportError\u001b[0m                               Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-67-90c2247a2c01>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mBar\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0moptions\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mopts\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m \u001b[0mbar\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mBar\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m \u001b[0mbar\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0madd_xaxis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mstar_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mImportError\u001b[0m: cannot import name 'Bar' from 'pyecharts.charts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\charts\\__init__.py)"
     ]
    }
   ],
   "source": [
    "from pyecharts.charts import Bar\n",
    "from pyecharts import options as opts\n",
    "\n",
    "bar = Bar()\n",
    "bar.add_xaxis(star_list)\n",
    "bar.add_yaxis(\"北京\", 北京)\n",
    "bar.add_yaxis(\"河北\", 河北)\n",
    "bar.add_yaxis(\"山西\", 山西)\n",
    "bar.add_yaxis(\"内蒙古\", 内蒙古)\n",
    "bar.add_yaxis(\"天津\", 天津)\n",
    "bar.set_global_opts(title_opts=opts.TitleOpts(title=\"华北地区景点不同星级数量\"))\n",
    "\n",
    "bar.render()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'Bar' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-68-eac0327af0a7>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      4\u001b[0m \u001b[0m海南\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;36m6\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m18\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m8\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m180\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[0mbar\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mBar\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      7\u001b[0m \u001b[0mbar\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0madd_xaxis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mstar_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      8\u001b[0m \u001b[0mbar\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0madd_yaxis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"广东\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0m广东\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'Bar' is not defined"
     ]
    }
   ],
   "source": [
    "# 华南地区\n",
    "广东 = [13,52,6,156]\n",
    "广西 = [10,65,15,124]\n",
    "海南 = [6,18,8,180]\n",
    "\n",
    "bar = Bar()\n",
    "bar.add_xaxis(star_list)\n",
    "bar.add_yaxis(\"广东\", 广东)\n",
    "bar.add_yaxis(\"广西\", 广西)\n",
    "bar.add_yaxis(\"海南\", 海南)\n",
    "bar.set_global_opts(title_opts=opts.TitleOpts(title=\"华南地区景点不同星级数量\"))\n",
    "\n",
    "bar.render()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'Bar' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-69-d540d28c2692>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      7\u001b[0m \u001b[0m江西\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;36m12\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m41\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m6\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m156\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      8\u001b[0m \u001b[0m福建\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;36m9\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m34\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m161\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 9\u001b[1;33m \u001b[0mbar\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mBar\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     10\u001b[0m \u001b[0mbar\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0madd_xaxis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mstar_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     11\u001b[0m \u001b[0mbar\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0madd_yaxis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"上海\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0m上海\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'Bar' is not defined"
     ]
    }
   ],
   "source": [
    "# 华东地区\n",
    "上海 = [3,33,8,171]\n",
    "江苏 = [39,50,11,115]\n",
    "浙江 = [25,59,11,120]\n",
    "山东 = [18,82,20,95]\n",
    "安徽 = [17,65,16,116]\n",
    "江西 = [12,41,6,156]\n",
    "福建 = [9,34,10,161]\n",
    "bar = Bar()\n",
    "bar.add_xaxis(star_list)\n",
    "bar.add_yaxis(\"上海\", 上海)\n",
    "bar.add_yaxis(\"江苏\", 江苏)\n",
    "bar.add_yaxis(\"浙江\", 浙江)\n",
    "bar.add_yaxis(\"山东\", 山东)\n",
    "bar.add_yaxis(\"安徽\", 安徽)\n",
    "bar.add_yaxis(\"江西\", 江西)\n",
    "bar.add_yaxis(\"福建\", 福建)\n",
    "bar.set_global_opts(title_opts=opts.TitleOpts(title=\"华东地区景点不同星级数量\"))\n",
    "\n",
    "bar.render()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\Daisy.C\\\\Desktop\\\\课件\\\\python数据可视化\\\\final_project\\\\render.html'"
      ]
     },
     "execution_count": 133,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 华中地区\n",
    "湖南 = [12,36,12,153]\n",
    "湖北 = [17,57,17,121]\n",
    "河南 = [19,62,12,121]\n",
    "bar = Bar()\n",
    "bar.add_xaxis(star_list)\n",
    "bar.add_yaxis(\"湖南\", 湖南)\n",
    "bar.add_yaxis(\"湖北\", 湖北)\n",
    "bar.add_yaxis(\"河北\", 河北)\n",
    "\n",
    "bar.set_global_opts(title_opts=opts.TitleOpts(title=\"华中地区景点不同星级数量\"))\n",
    "\n",
    "bar.render()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\Daisy.C\\\\Desktop\\\\课件\\\\python数据可视化\\\\final_project\\\\render.html'"
      ]
     },
     "execution_count": 126,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 西南地区\n",
    "云南 = [9,48,13,145]\n",
    "四川 = [12,61,5,137]\n",
    "西藏 = [4,6,10,196]\n",
    "贵州 = [6,28,14,167]\n",
    "重庆 = [13,39,10,152]\n",
    "bar = Bar()\n",
    "bar.add_xaxis(star_list)\n",
    "bar.add_yaxis(\"云南\", 云南)\n",
    "bar.add_yaxis(\"四川\", 四川)\n",
    "bar.add_yaxis(\"西藏\", 西藏)\n",
    "bar.add_yaxis(\"贵州\", 贵州)\n",
    "bar.add_yaxis(\"重庆\", 重庆)\n",
    "\n",
    "bar.set_global_opts(title_opts=opts.TitleOpts(title=\"西南地区景点不同星级数量\"))\n",
    "\n",
    "bar.render()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\Daisy.C\\\\Desktop\\\\课件\\\\python数据可视化\\\\final_project\\\\render.html'"
      ]
     },
     "execution_count": 134,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 西北地区\n",
    "宁夏 = [4,16,12,181]\n",
    "新疆 = [14,34,33,133]\n",
    "甘肃 = [4,49,11,149]\n",
    "陕西 = [11,38,19,147]\n",
    "青海 = [6,18,31,157]\n",
    "bar = Bar()\n",
    "bar.add_xaxis(star_list)\n",
    "bar.add_yaxis(\"宁夏\", 宁夏)\n",
    "bar.add_yaxis(\"新疆\", 新疆)\n",
    "bar.add_yaxis(\"甘肃\", 甘肃)\n",
    "bar.add_yaxis(\"陕西\", 陕西)\n",
    "bar.add_yaxis(\"青海\", 青海)\n",
    "\n",
    "bar.set_global_opts(title_opts=opts.TitleOpts(title=\"西北地区景点不同星级数量\"))\n",
    "\n",
    "bar.render()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\Daisy.C\\\\Desktop\\\\课件\\\\python数据可视化\\\\final_project\\\\render.html'"
      ]
     },
     "execution_count": 140,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 东北地区\n",
    "吉林 = [8,26,19,161]\n",
    "辽宁 = [6,45,14,148]\n",
    "黑龙江 = [5,39,35,134]\n",
    "bar = Bar()\n",
    "bar.add_xaxis(star_list)\n",
    "bar.add_yaxis(\"吉林\", 吉林)\n",
    "bar.add_yaxis(\"辽宁\", 辽宁)\n",
    "bar.add_yaxis(\"黑龙江\", 黑龙江)\n",
    "\n",
    "bar.set_global_opts(title_opts=opts.TitleOpts(title=\"东北地区景点不同星级数量\"))\n",
    "\n",
    "bar.render()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\Daisy.C\\\\Desktop\\\\课件\\\\python数据可视化\\\\final_project\\\\render.html'"
      ]
     },
     "execution_count": 145,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 港澳台地区\n",
    "香港 = [0,0,0,207]\n",
    "澳门 = [0,0,1,205]\n",
    "台湾 = [0,0,0,215]\n",
    "bar = Bar()\n",
    "bar.add_xaxis(star_list)\n",
    "bar.add_yaxis(\"香港\", 香港)\n",
    "bar.add_yaxis(\"澳门\", 澳门)\n",
    "bar.add_yaxis(\"台湾\", 台湾)\n",
    "\n",
    "bar.set_global_opts(title_opts=opts.TitleOpts(title=\"港澳台地区景点不同星级数量\"))\n",
    "\n",
    "bar.render()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# （新）馆区类景区：\n",
    "艺术馆、博物馆、公园、植物园、动物园、主题乐园、纪念馆"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [],
   "source": [
    "sightseeing_leibie = ['艺术馆','博物馆','公园','植物园','动物园','主题乐园','纪念馆']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[38, 181, 509, 37, 62, 26, 27, 16, 65, 75, 0, 53, 23]"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "艺术馆_data = df_new[df_new['景点名称'].str.contains('艺术馆')]\n",
    "博物馆_data = df_new[df_new['景点名称'].str.contains('博物馆')]\n",
    "公园_data = df_new[df_new['景点名称'].str.contains('公园')]\n",
    "植物园_data = df_new[df_new['景点名称'].str.contains('植物园')]\n",
    "动物园_data = df_new[df_new['景点名称'].str.contains('动物园')]\n",
    "主题乐园_data = df_new[df_new['景点名称'].str.contains('主题乐园')]\n",
    "纪念馆_data = df_new[df_new['景点名称'].str.contains('纪念馆')]\n",
    "海洋馆_data = df_new[df_new['景点名称'].str.contains('海洋馆')]\n",
    "度假村_data = df_new[df_new['景点名称'].str.contains('度假村')]\n",
    "滑雪场_data = df_new[df_new['景点名称'].str.contains('滑雪场')]\n",
    "水上世界_data = df_new[df_new['景点名称'].str.contains('水上世界')]\n",
    "古镇_data = df_new[df_new['景点名称'].str.contains('古镇')]\n",
    "游乐园_data = df_new[df_new['景点名称'].str.contains('游乐园')]\n",
    "# len(yishu_data)\n",
    "\n",
    "sightseeing_num = [len(艺术馆_data),len(博物馆_data),len(公园_data),len(植物园_data),len(动物园_data),len(主题乐园_data),len(纪念馆_data),len(海洋馆_data),len(度假村_data),len(滑雪场_data),len(水上世界_data),len(古镇_data),len(游乐园_data)]\n",
    "sightseeing_num"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 词云图的绘制"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: pyecharts==0.5.11 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (0.5.11)\n",
      "Requirement already satisfied: pyecharts-javascripthon==0.0.6 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from pyecharts==0.5.11) (0.0.6)\n",
      "Requirement already satisfied: future in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from pyecharts==0.5.11) (0.18.2)\n",
      "Requirement already satisfied: jupyter-echarts-pypkg==0.1.2 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from pyecharts==0.5.11) (0.1.2)\n",
      "Requirement already satisfied: jinja2 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from pyecharts==0.5.11) (2.11.2)\n",
      "Requirement already satisfied: lml==0.0.2 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from pyecharts==0.5.11) (0.0.2)\n",
      "Requirement already satisfied: pillow in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from pyecharts==0.5.11) (7.2.0)\n",
      "Requirement already satisfied: javascripthon>=0.10; python_version > \"3.4\" in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from pyecharts-javascripthon==0.0.6->pyecharts==0.5.11) (0.11)\n",
      "Requirement already satisfied: pyecharts-jupyter-installer==0.0.3 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from jupyter-echarts-pypkg==0.1.2->pyecharts==0.5.11) (0.0.3)\n",
      "Requirement already satisfied: MarkupSafe>=0.23 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from jinja2->pyecharts==0.5.11) (1.1.1)\n",
      "Requirement already satisfied: dukpy in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from javascripthon>=0.10; python_version > \"3.4\"->pyecharts-javascripthon==0.0.6->pyecharts==0.5.11) (0.2.3)\n",
      "Requirement already satisfied: macropy3==1.1.0b2 in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from javascripthon>=0.10; python_version > \"3.4\"->pyecharts-javascripthon==0.0.6->pyecharts==0.5.11) (1.1.0b2)\n",
      "Requirement already satisfied: setuptools in c:\\users\\daisy.c\\anaconda3\\lib\\site-packages (from javascripthon>=0.10; python_version > \"3.4\"->pyecharts-javascripthon==0.0.6->pyecharts==0.5.11) (49.2.0.post20200714)\n"
     ]
    }
   ],
   "source": [
    "!pip install pyecharts==0.5.11"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "ERROR:lml.utils:failed to import pyecharts_snapshot\n",
      "Traceback (most recent call last):\n",
      "  File \"C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\lml\\utils.py\", line 43, in do_import\n",
      "    plugin_module = __import__(plugin_module_name)\n",
      "ModuleNotFoundError: No module named 'pyecharts_snapshot'\n"
     ]
    },
    {
     "ename": "ImportError",
     "evalue": "cannot import name 'options' from 'pyecharts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\__init__.py)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mImportError\u001b[0m                               Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-1-49b3b01b835b>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0moptions\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mopts\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mWordCloud\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mglobals\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mSymbolType\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mImportError\u001b[0m: cannot import name 'options' from 'pyecharts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\__init__.py)"
     ]
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import WordCloud\n",
    "from pyecharts.globals import SymbolType\n",
    "\n",
    "\n",
    "words = [\n",
    "    ('艺术馆','38'),\n",
    "    ('博物馆','181'),\n",
    "    ('公园','509'),\n",
    "    ('植物园','37'),\n",
    "    ('动物园','62'),\n",
    "    ('主题乐园','26'),\n",
    "    ('纪念馆','27')\n",
    "]\n",
    "c = (\n",
    "    WordCloud()\n",
    "    .add(\"\", words, word_size_range=[20, 100], shape=SymbolType.DIAMOND)\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"WordCloud-shape-diamond\"))\n",
    "    .render(\"wordcloud_diamond.html\")\n",
    ")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['上海欢乐谷',\n",
       " '上海迪士尼乐园',\n",
       " '上海海昌海洋公园',\n",
       " '朱家角古镇',\n",
       " '上海世博园',\n",
       " '上海长风海洋世界',\n",
       " '佘山国家旅游度假区',\n",
       " '东方明珠',\n",
       " '东方绿舟',\n",
       " '上海植物园']"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "children_ascending_df = df_new[df_new.省.str.contains('上海')].sort_values('儿童旅客量',ascending=False)\n",
    "c_df = children_ascending_df[0:10]\n",
    "c_df['景点名称'].tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[55, 27, 18, 13, 8, 8, 7, 5, 4, 4]"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c_df['儿童旅客量'].tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "      <th>省</th>\n",
       "      <th>市</th>\n",
       "      <th>区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>豫园</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.2</td>\n",
       "      <td>“奇秀甲于东南”、“东南名园冠”。</td>\n",
       "      <td>121.498981,31.232772</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>820</td>\n",
       "      <td>39.8</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>黄浦区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>上海野生动物园</td>\n",
       "      <td>5A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>与野生动物近距离的“亲密接触”</td>\n",
       "      <td>121.728112,31.059636</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>2667</td>\n",
       "      <td>17.1</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>上海欢乐谷</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>游乐项目惊险刺激，特色表演异彩纷呈</td>\n",
       "      <td>121.22218,31.102491</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>55</td>\n",
       "      <td>4394</td>\n",
       "      <td>213.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>松江区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>上海海昌海洋公园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>感受海洋公园乐趣</td>\n",
       "      <td>121.915647,30.917713</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>18</td>\n",
       "      <td>4094</td>\n",
       "      <td>178.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>上海动物园</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>带你领略动物世界的纷繁多彩</td>\n",
       "      <td>121.369411,31.199264</td>\n",
       "      <td>上海·上海·长宁区</td>\n",
       "      <td>0</td>\n",
       "      <td>642</td>\n",
       "      <td>39.9</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>长宁区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7272</th>\n",
       "      <td>53155</td>\n",
       "      <td>冰情岛达人汇滑雪场</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>驰名中外的冰雪大世界综合滑雪场所</td>\n",
       "      <td>126.571327,45.778679</td>\n",
       "      <td>黑龙江·哈尔滨·松北区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>哈尔滨</td>\n",
       "      <td>松北区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7273</th>\n",
       "      <td>53156</td>\n",
       "      <td>齐齐哈尔奥悦水世界</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>七月盛装开园，水上乐园一枝独秀</td>\n",
       "      <td>123.949088,47.286358</td>\n",
       "      <td>黑龙江·齐齐哈尔·龙沙区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>齐齐哈尔</td>\n",
       "      <td>龙沙区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7274</th>\n",
       "      <td>53157</td>\n",
       "      <td>李氏陶艺（中央大街店）</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>集吃、喝、玩、乐于一体的特色DIY工坊</td>\n",
       "      <td>126.626672,45.775049</td>\n",
       "      <td>黑龙江·哈尔滨·道里区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>哈尔滨</td>\n",
       "      <td>道里区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7275</th>\n",
       "      <td>53158</td>\n",
       "      <td>亚布力锅盔山休闲景区</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>古树参天，绿草如茵</td>\n",
       "      <td>128.441239,44.750047</td>\n",
       "      <td>黑龙江·哈尔滨·亚布力新体委滑雪场</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>哈尔滨</td>\n",
       "      <td>亚布力新体委滑雪场</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7276</th>\n",
       "      <td>53159</td>\n",
       "      <td>关东古巷</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>哈尔滨时光隧道</td>\n",
       "      <td>126.573464,45.740076</td>\n",
       "      <td>黑龙江·哈尔滨·道里区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>黑龙江</td>\n",
       "      <td>哈尔滨</td>\n",
       "      <td>道里区</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>7277 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      index         景点名称  星级   评分                   介绍                   经纬度  \\\n",
       "0         0           豫园  4A  4.2    “奇秀甲于东南”、“东南名园冠”。  121.498981,31.232772   \n",
       "1         1      上海野生动物园  5A  3.6      与野生动物近距离的“亲密接触”  121.728112,31.059636   \n",
       "2         2        上海欢乐谷  4A  3.6    游乐项目惊险刺激，特色表演异彩纷呈   121.22218,31.102491   \n",
       "3         3     上海海昌海洋公园   无  0.0             感受海洋公园乐趣  121.915647,30.917713   \n",
       "4         4        上海动物园  4A  3.6        带你领略动物世界的纷繁多彩  121.369411,31.199264   \n",
       "...     ...          ...  ..  ...                  ...                   ...   \n",
       "7272  53155    冰情岛达人汇滑雪场   无  0.0     驰名中外的冰雪大世界综合滑雪场所  126.571327,45.778679   \n",
       "7273  53156    齐齐哈尔奥悦水世界   无  0.0      七月盛装开园，水上乐园一枝独秀  123.949088,47.286358   \n",
       "7274  53157  李氏陶艺（中央大街店）   无  0.0  集吃、喝、玩、乐于一体的特色DIY工坊  126.626672,45.775049   \n",
       "7275  53158   亚布力锅盔山休闲景区   无  0.0            古树参天，绿草如茵  128.441239,44.750047   \n",
       "7276  53159         关东古巷   无  0.0              哈尔滨时光隧道  126.573464,45.740076   \n",
       "\n",
       "                   所在地区  儿童旅客量   销售量     门票    省     市          区  \n",
       "0             上海·上海·黄浦区      0   820   39.8   上海    上海        黄浦区  \n",
       "1            上海·上海·浦东新区      0  2667   17.1   上海    上海       浦东新区  \n",
       "2             上海·上海·松江区     55  4394  213.0   上海    上海        松江区  \n",
       "3            上海·上海·浦东新区     18  4094  178.0   上海    上海       浦东新区  \n",
       "4             上海·上海·长宁区      0   642   39.9   上海    上海        长宁区  \n",
       "...                 ...    ...   ...    ...  ...   ...        ...  \n",
       "7272        黑龙江·哈尔滨·松北区      0     0    0.0  黑龙江   哈尔滨        松北区  \n",
       "7273       黑龙江·齐齐哈尔·龙沙区      0     0    0.0  黑龙江  齐齐哈尔        龙沙区  \n",
       "7274        黑龙江·哈尔滨·道里区      0     0    0.0  黑龙江   哈尔滨        道里区  \n",
       "7275  黑龙江·哈尔滨·亚布力新体委滑雪场      0     0    0.0  黑龙江   哈尔滨  亚布力新体委滑雪场  \n",
       "7276        黑龙江·哈尔滨·道里区      0     0    0.0  黑龙江   哈尔滨        道里区  \n",
       "\n",
       "[7277 rows x 13 columns]"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_new"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "      <th>省</th>\n",
       "      <th>市</th>\n",
       "      <th>区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>上海欢乐谷</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>游乐项目惊险刺激，特色表演异彩纷呈</td>\n",
       "      <td>121.22218,31.102491</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>55</td>\n",
       "      <td>4394</td>\n",
       "      <td>213.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>松江区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>上海海昌海洋公园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>感受海洋公园乐趣</td>\n",
       "      <td>121.915647,30.917713</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>18</td>\n",
       "      <td>4094</td>\n",
       "      <td>178.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>上海野生动物园</td>\n",
       "      <td>5A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>与野生动物近距离的“亲密接触”</td>\n",
       "      <td>121.728112,31.059636</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>2667</td>\n",
       "      <td>17.1</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>8</td>\n",
       "      <td>浦江郊野公园奇迹花园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>来奇迹花园开启一段花之奇旅吧</td>\n",
       "      <td>121.509672,31.060409</td>\n",
       "      <td>上海·上海·闵行区</td>\n",
       "      <td>0</td>\n",
       "      <td>1074</td>\n",
       "      <td>49.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>闵行区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>27</td>\n",
       "      <td>上海周浦花海</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>一年四季鲜花不断，汇成令人迷醉的花海</td>\n",
       "      <td>121.65535,31.118973</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>826</td>\n",
       "      <td>39.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>豫园</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.2</td>\n",
       "      <td>“奇秀甲于东南”、“东南名园冠”。</td>\n",
       "      <td>121.498981,31.232772</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>820</td>\n",
       "      <td>39.8</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>黄浦区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>上海动物园</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>带你领略动物世界的纷繁多彩</td>\n",
       "      <td>121.369411,31.199264</td>\n",
       "      <td>上海·上海·长宁区</td>\n",
       "      <td>0</td>\n",
       "      <td>642</td>\n",
       "      <td>39.9</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>长宁区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>49</td>\n",
       "      <td>上海海湾国家森林公园</td>\n",
       "      <td>4A</td>\n",
       "      <td>0.0</td>\n",
       "      <td>近似自然形态的人工森林</td>\n",
       "      <td>121.692869,30.86719</td>\n",
       "      <td>上海·上海·奉贤区</td>\n",
       "      <td>2</td>\n",
       "      <td>580</td>\n",
       "      <td>35.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>奉贤区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>35</td>\n",
       "      <td>滨江森林公园</td>\n",
       "      <td>无</td>\n",
       "      <td>3.5</td>\n",
       "      <td>郊野森里公园，就在你的身边</td>\n",
       "      <td>121.533982,31.389491</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>450</td>\n",
       "      <td>20.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>6</td>\n",
       "      <td>东方绿舟</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.5</td>\n",
       "      <td>全国首屈一指的青少年校外教育营地</td>\n",
       "      <td>121.015977,31.107866</td>\n",
       "      <td>上海·上海·青浦区</td>\n",
       "      <td>4</td>\n",
       "      <td>384</td>\n",
       "      <td>44.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>青浦区</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    index        景点名称  星级   评分                  介绍                   经纬度  \\\n",
       "2       2       上海欢乐谷  4A  3.6   游乐项目惊险刺激，特色表演异彩纷呈   121.22218,31.102491   \n",
       "3       3    上海海昌海洋公园   无  0.0            感受海洋公园乐趣  121.915647,30.917713   \n",
       "1       1     上海野生动物园  5A  3.6     与野生动物近距离的“亲密接触”  121.728112,31.059636   \n",
       "8       8  浦江郊野公园奇迹花园   无  0.0      来奇迹花园开启一段花之奇旅吧  121.509672,31.060409   \n",
       "27     27      上海周浦花海   无  0.0  一年四季鲜花不断，汇成令人迷醉的花海   121.65535,31.118973   \n",
       "0       0          豫园  4A  4.2   “奇秀甲于东南”、“东南名园冠”。  121.498981,31.232772   \n",
       "4       4       上海动物园  4A  3.6       带你领略动物世界的纷繁多彩  121.369411,31.199264   \n",
       "49     49  上海海湾国家森林公园  4A  0.0         近似自然形态的人工森林   121.692869,30.86719   \n",
       "35     35      滨江森林公园   无  3.5       郊野森里公园，就在你的身边  121.533982,31.389491   \n",
       "6       6        东方绿舟  4A  3.5    全国首屈一指的青少年校外教育营地  121.015977,31.107866   \n",
       "\n",
       "          所在地区  儿童旅客量   销售量     门票   省   市     区  \n",
       "2    上海·上海·松江区     55  4394  213.0  上海  上海   松江区  \n",
       "3   上海·上海·浦东新区     18  4094  178.0  上海  上海  浦东新区  \n",
       "1   上海·上海·浦东新区      0  2667   17.1  上海  上海  浦东新区  \n",
       "8    上海·上海·闵行区      0  1074   49.0  上海  上海   闵行区  \n",
       "27  上海·上海·浦东新区      0   826   39.0  上海  上海  浦东新区  \n",
       "0    上海·上海·黄浦区      0   820   39.8  上海  上海   黄浦区  \n",
       "4    上海·上海·长宁区      0   642   39.9  上海  上海   长宁区  \n",
       "49   上海·上海·奉贤区      2   580   35.0  上海  上海   奉贤区  \n",
       "35  上海·上海·浦东新区      0   450   20.0  上海  上海  浦东新区  \n",
       "6    上海·上海·青浦区      4   384   44.0  上海  上海   青浦区  "
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all_ascending_df = df_new[df_new.省.str.contains('上海')].sort_values('销售量',ascending=False)\n",
    "all_ascending_df[0:10]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 水滴图的绘制"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "      <th>省</th>\n",
       "      <th>市</th>\n",
       "      <th>区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>豫园</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.2</td>\n",
       "      <td>“奇秀甲于东南”、“东南名园冠”。</td>\n",
       "      <td>121.498981,31.232772</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>820</td>\n",
       "      <td>39.8</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>黄浦区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>上海野生动物园</td>\n",
       "      <td>5A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>与野生动物近距离的“亲密接触”</td>\n",
       "      <td>121.728112,31.059636</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>0</td>\n",
       "      <td>2667</td>\n",
       "      <td>17.1</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>上海欢乐谷</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>游乐项目惊险刺激，特色表演异彩纷呈</td>\n",
       "      <td>121.22218,31.102491</td>\n",
       "      <td>上海·上海·松江区</td>\n",
       "      <td>55</td>\n",
       "      <td>4394</td>\n",
       "      <td>213.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>松江区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>上海海昌海洋公园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>感受海洋公园乐趣</td>\n",
       "      <td>121.915647,30.917713</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>18</td>\n",
       "      <td>4094</td>\n",
       "      <td>178.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>上海动物园</td>\n",
       "      <td>4A</td>\n",
       "      <td>3.6</td>\n",
       "      <td>带你领略动物世界的纷繁多彩</td>\n",
       "      <td>121.369411,31.199264</td>\n",
       "      <td>上海·上海·长宁区</td>\n",
       "      <td>0</td>\n",
       "      <td>642</td>\n",
       "      <td>39.9</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>长宁区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>210</th>\n",
       "      <td>220</td>\n",
       "      <td>大清邮局</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>快来围观大清朝的明信片</td>\n",
       "      <td>121.060185,31.113169</td>\n",
       "      <td>上海·上海·朱家角古镇</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>朱家角古镇</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>211</th>\n",
       "      <td>221</td>\n",
       "      <td>上海马戏城</td>\n",
       "      <td>无</td>\n",
       "      <td>3.6</td>\n",
       "      <td>上海国际文化都市的标志性建筑</td>\n",
       "      <td>121.458503,31.285845</td>\n",
       "      <td>上海·上海·闸北区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>闸北区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>212</th>\n",
       "      <td>222</td>\n",
       "      <td>上海JOYPOLIS乐园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>身临其境感受无与伦比的美感</td>\n",
       "      <td>121.418723,31.238504</td>\n",
       "      <td>上海·上海·普陀区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>普陀区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>213</th>\n",
       "      <td>223</td>\n",
       "      <td>元祖启蒙乐园</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>游玩其中，开启儿童智慧，激发身体潜能</td>\n",
       "      <td>121.233633,31.155621</td>\n",
       "      <td>上海·上海·青浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>青浦区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>214</th>\n",
       "      <td>224</td>\n",
       "      <td>环球奇趣体验馆</td>\n",
       "      <td>无</td>\n",
       "      <td>0.0</td>\n",
       "      <td>一馆玩遍世界超新奇趣体验</td>\n",
       "      <td>121.497752,31.232364</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>黄浦区</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>215 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     index          景点名称  星级   评分                  介绍                   经纬度  \\\n",
       "0        0            豫园  4A  4.2   “奇秀甲于东南”、“东南名园冠”。  121.498981,31.232772   \n",
       "1        1       上海野生动物园  5A  3.6     与野生动物近距离的“亲密接触”  121.728112,31.059636   \n",
       "2        2         上海欢乐谷  4A  3.6   游乐项目惊险刺激，特色表演异彩纷呈   121.22218,31.102491   \n",
       "3        3      上海海昌海洋公园   无  0.0            感受海洋公园乐趣  121.915647,30.917713   \n",
       "4        4         上海动物园  4A  3.6       带你领略动物世界的纷繁多彩  121.369411,31.199264   \n",
       "..     ...           ...  ..  ...                 ...                   ...   \n",
       "210    220          大清邮局   无  0.0         快来围观大清朝的明信片  121.060185,31.113169   \n",
       "211    221         上海马戏城   无  3.6      上海国际文化都市的标志性建筑  121.458503,31.285845   \n",
       "212    222  上海JOYPOLIS乐园   无  0.0       身临其境感受无与伦比的美感  121.418723,31.238504   \n",
       "213    223        元祖启蒙乐园   无  0.0  游玩其中，开启儿童智慧，激发身体潜能  121.233633,31.155621   \n",
       "214    224       环球奇趣体验馆   无  0.0        一馆玩遍世界超新奇趣体验  121.497752,31.232364   \n",
       "\n",
       "            所在地区  儿童旅客量   销售量     门票   省   市      区  \n",
       "0      上海·上海·黄浦区      0   820   39.8  上海  上海    黄浦区  \n",
       "1     上海·上海·浦东新区      0  2667   17.1  上海  上海   浦东新区  \n",
       "2      上海·上海·松江区     55  4394  213.0  上海  上海    松江区  \n",
       "3     上海·上海·浦东新区     18  4094  178.0  上海  上海   浦东新区  \n",
       "4      上海·上海·长宁区      0   642   39.9  上海  上海    长宁区  \n",
       "..           ...    ...   ...    ...  ..  ..    ...  \n",
       "210  上海·上海·朱家角古镇      0     0    0.0  上海  上海  朱家角古镇  \n",
       "211    上海·上海·闸北区      0     0    0.0  上海  上海    闸北区  \n",
       "212    上海·上海·普陀区      0     0    0.0  上海  上海    普陀区  \n",
       "213    上海·上海·青浦区      0     0    0.0  上海  上海    青浦区  \n",
       "214    上海·上海·黄浦区      0     0    0.0  上海  上海    黄浦区  \n",
       "\n",
       "[215 rows x 13 columns]"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "province_df = df_new[df_new.省.str.contains('上海')]\n",
    "province_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.13"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 四川\n",
    "四川_景点好评率 = len(df_new[df_new.省.str.contains('四川')][(df_new[df_new.省.str.contains('四川')][\"评分\"]>4)&(df_new[df_new.省.str.contains('四川')][\"评分\"]<=5)])/len(df_new[df_new.省.str.contains('四川')])\n",
    "四川_景点中评率 = len(df_new[df_new.省.str.contains('四川')][(df_new[df_new.省.str.contains('四川')][\"评分\"]>3)&(df_new[df_new.省.str.contains('四川')][\"评分\"]<=4)])/len(df_new[df_new.省.str.contains('四川')])\n",
    "四川_景点差评率 = len(df_new[df_new.省.str.contains('四川')][(df_new[df_new.省.str.contains('四川')][\"评分\"]>=0)&(df_new[df_new.省.str.contains('四川')][\"评分\"]<=3)])/len(df_new[df_new.省.str.contains('四川')])\n",
    "四川景点好评率 = round(四川_景点好评率, 2)\n",
    "四川景点中评率 = round(四川_景点中评率, 2)\n",
    "四川景点差评率 = round(四川_景点差评率, 2)\n",
    "\n",
    "# 广东\n",
    "广东_景点好评率 = len(df_new[df_new.省.str.contains('广东')][(df_new[df_new.省.str.contains('广东')][\"评分\"]>4)&(df_new[df_new.省.str.contains('广东')][\"评分\"]<=5)])/len(df_new[df_new.省.str.contains('广东')])\n",
    "广东_景点中评率 = len(df_new[df_new.省.str.contains('广东')][(df_new[df_new.省.str.contains('广东')][\"评分\"]>3)&(df_new[df_new.省.str.contains('广东')][\"评分\"]<=4)])/len(df_new[df_new.省.str.contains('广东')])\n",
    "广东_景点差评率 = len(df_new[df_new.省.str.contains('广东')][(df_new[df_new.省.str.contains('广东')][\"评分\"]>=0)&(df_new[df_new.省.str.contains('广东')][\"评分\"]<=3)])/len(df_new[df_new.省.str.contains('广东')])\n",
    "广东景点好评率 = round(广东_景点好评率, 2)\n",
    "广东景点中评率 = round(广东_景点中评率, 2)\n",
    "广东景点差评率 = round(广东_景点差评率, 2)\n",
    "\n",
    "# 北京\n",
    "北京_景点好评率 = len(df_new[df_new.省.str.contains('北京')][(df_new[df_new.省.str.contains('北京')][\"评分\"]>4)&(df_new[df_new.省.str.contains('北京')][\"评分\"]<=5)])/len(df_new[df_new.省.str.contains('北京')])\n",
    "北京_景点中评率 = len(df_new[df_new.省.str.contains('北京')][(df_new[df_new.省.str.contains('北京')][\"评分\"]>3)&(df_new[df_new.省.str.contains('北京')][\"评分\"]<=4)])/len(df_new[df_new.省.str.contains('北京')])\n",
    "北京_景点差评率 = len(df_new[df_new.省.str.contains('北京')][(df_new[df_new.省.str.contains('北京')][\"评分\"]>=0)&(df_new[df_new.省.str.contains('北京')][\"评分\"]<=3)])/len(df_new[df_new.省.str.contains('北京')])\n",
    "北京景点好评率 = round(北京_景点好评率, 2)\n",
    "北京景点中评率 = round(北京_景点中评率, 2)\n",
    "北京景点差评率 = round(北京_景点差评率, 2)\n",
    "\n",
    "# 海南\n",
    "海南_景点好评率 = len(df_new[df_new.省.str.contains('海南')][(df_new[df_new.省.str.contains('海南')][\"评分\"]>4)&(df_new[df_new.省.str.contains('海南')][\"评分\"]<=5)])/len(df_new[df_new.省.str.contains('海南')])\n",
    "海南_景点中评率 = len(df_new[df_new.省.str.contains('海南')][(df_new[df_new.省.str.contains('海南')][\"评分\"]>3)&(df_new[df_new.省.str.contains('海南')][\"评分\"]<=4)])/len(df_new[df_new.省.str.contains('海南')])\n",
    "海南_景点差评率 = len(df_new[df_new.省.str.contains('海南')][(df_new[df_new.省.str.contains('海南')][\"评分\"]>=0)&(df_new[df_new.省.str.contains('海南')][\"评分\"]<=3)])/len(df_new[df_new.省.str.contains('海南')])\n",
    "海南景点好评率 = round(海南_景点好评率, 2)\n",
    "海南景点中评率 = round(海南_景点中评率, 2)\n",
    "海南景点差评率 = round(海南_景点差评率, 2)\n",
    "\n",
    "\n",
    "# 江苏\n",
    "江苏_景点好评率 = len(df_new[df_new.省.str.contains('江苏')][(df_new[df_new.省.str.contains('江苏')][\"评分\"]>4)&(df_new[df_new.省.str.contains('江苏')][\"评分\"]<=5)])/len(df_new[df_new.省.str.contains('江苏')])\n",
    "江苏_景点中评率 = len(df_new[df_new.省.str.contains('江苏')][(df_new[df_new.省.str.contains('江苏')][\"评分\"]>3)&(df_new[df_new.省.str.contains('江苏')][\"评分\"]<=4)])/len(df_new[df_new.省.str.contains('江苏')])\n",
    "江苏_景点差评率 = len(df_new[df_new.省.str.contains('江苏')][(df_new[df_new.省.str.contains('江苏')][\"评分\"]>=0)&(df_new[df_new.省.str.contains('江苏')][\"评分\"]<=3)])/len(df_new[df_new.省.str.contains('江苏')])\n",
    "江苏景点好评率 = round(江苏_景点好评率, 2)\n",
    "江苏景点中评率 = round(江苏_景点中评率, 2)\n",
    "江苏景点差评率 = round(江苏_景点差评率, 2)\n",
    "\n",
    "四川景点好评率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "ERROR:lml.utils:failed to import pyecharts_snapshot\n",
      "Traceback (most recent call last):\n",
      "  File \"C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\lml\\utils.py\", line 43, in do_import\n",
      "    plugin_module = __import__(plugin_module_name)\n",
      "ModuleNotFoundError: No module named 'pyecharts_snapshot'\n"
     ]
    },
    {
     "ename": "ImportError",
     "evalue": "cannot import name 'options' from 'pyecharts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\__init__.py)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mImportError\u001b[0m                               Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-51-e7386cc6e1f7>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0moptions\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mopts\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcharts\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mGrid\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mLiquid\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpyecharts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcommons\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mutils\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mJsCode\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m \u001b[1;31m# 四川\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mImportError\u001b[0m: cannot import name 'options' from 'pyecharts' (C:\\Users\\Daisy.C\\anaconda3\\lib\\site-packages\\pyecharts\\__init__.py)"
     ]
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Grid, Liquid\n",
    "from pyecharts.commons.utils import JsCode\n",
    "\n",
    "# 四川\n",
    "l1 = (\n",
    "    Liquid()\n",
    "    .add(\"lq\", [四川景点好评率], center=[\"60%\", \"50%\"])\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"多个 Liquid 显示\"))\n",
    ")\n",
    "\n",
    "l2 = Liquid().add(\n",
    "    \"lq\",\n",
    "    [四川景点差评率],\n",
    "    center=[\"25%\", \"50%\"],\n",
    "    label_opts=opts.LabelOpts(\n",
    "        font_size=50,\n",
    "        formatter=JsCode(\n",
    "            \"\"\"function (param) {\n",
    "                    return (Math.floor(param.value * 10000) / 100) + '%';\n",
    "                }\"\"\"\n",
    "        ),\n",
    "        position=\"inside\",\n",
    "    ),\n",
    ")\n",
    "\n",
    "grid = Grid().add(l1, grid_opts=opts.GridOpts()).add(l2, grid_opts=opts.GridOpts())\n",
    "grid.render(\"multiple_liquid.html\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "      <th>省</th>\n",
       "      <th>市</th>\n",
       "      <th>区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>豫园</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.2</td>\n",
       "      <td>“奇秀甲于东南”、“东南名园冠”。</td>\n",
       "      <td>121.498981,31.232772</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>820</td>\n",
       "      <td>39.8</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>黄浦区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>25</td>\n",
       "      <td>外滩</td>\n",
       "      <td>无</td>\n",
       "      <td>5.0</td>\n",
       "      <td>感受上海十里洋场的风景</td>\n",
       "      <td>121.497854,31.240722</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>92</td>\n",
       "      <td>66.6</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>黄浦区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>53</td>\n",
       "      <td>上海世博园</td>\n",
       "      <td>无</td>\n",
       "      <td>4.1</td>\n",
       "      <td>追忆昔日世博盛况</td>\n",
       "      <td>121.490185,31.199998</td>\n",
       "      <td>上海·上海·浦东新区</td>\n",
       "      <td>8</td>\n",
       "      <td>35</td>\n",
       "      <td>80.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>浦东新区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>26</td>\n",
       "      <td>南京路步行街</td>\n",
       "      <td>无</td>\n",
       "      <td>4.1</td>\n",
       "      <td>火树银花不夜天，霓虹商业一条街</td>\n",
       "      <td>121.474776,31.234851</td>\n",
       "      <td>上海·上海·黄浦区</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>178.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海</td>\n",
       "      <td>黄浦区</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    index    景点名称  星级   评分                 介绍                   经纬度  \\\n",
       "0       0      豫园  4A  4.2  “奇秀甲于东南”、“东南名园冠”。  121.498981,31.232772   \n",
       "25     25      外滩   无  5.0        感受上海十里洋场的风景  121.497854,31.240722   \n",
       "53     53   上海世博园   无  4.1           追忆昔日世博盛况  121.490185,31.199998   \n",
       "26     26  南京路步行街   无  4.1    火树银花不夜天，霓虹商业一条街  121.474776,31.234851   \n",
       "\n",
       "          所在地区  儿童旅客量  销售量     门票   省   市     区  \n",
       "0    上海·上海·黄浦区      0  820   39.8  上海  上海   黄浦区  \n",
       "25   上海·上海·黄浦区      0   92   66.6  上海  上海   黄浦区  \n",
       "53  上海·上海·浦东新区      8   35   80.0  上海  上海  浦东新区  \n",
       "26   上海·上海·黄浦区      0    2  178.0  上海  上海   黄浦区  "
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "上海_门票_ascending = df_new[df_new.省.str.contains('上海')].sort_values('门票',ascending=True)\n",
    "上海_门票_ascending[上海_门票_ascending[\"评分\"]>=4]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>景点名称</th>\n",
       "      <th>星级</th>\n",
       "      <th>评分</th>\n",
       "      <th>介绍</th>\n",
       "      <th>经纬度</th>\n",
       "      <th>所在地区</th>\n",
       "      <th>儿童旅客量</th>\n",
       "      <th>销售量</th>\n",
       "      <th>门票</th>\n",
       "      <th>省</th>\n",
       "      <th>市</th>\n",
       "      <th>区</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2624</th>\n",
       "      <td>20241</td>\n",
       "      <td>圆明新园</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.7</td>\n",
       "      <td>原尺寸仿建北京圆明园</td>\n",
       "      <td>113.544454,22.246264</td>\n",
       "      <td>广东·珠海·香洲区</td>\n",
       "      <td>11</td>\n",
       "      <td>4</td>\n",
       "      <td>0.5</td>\n",
       "      <td>广东</td>\n",
       "      <td>珠海</td>\n",
       "      <td>香洲区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2677</th>\n",
       "      <td>20294</td>\n",
       "      <td>淡浮院</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.1</td>\n",
       "      <td>坐东面西，依山傍水，风景绝佳</td>\n",
       "      <td>116.706533,23.683279</td>\n",
       "      <td>广东·潮州·湘桥区</td>\n",
       "      <td>0</td>\n",
       "      <td>46</td>\n",
       "      <td>30.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>潮州</td>\n",
       "      <td>湘桥区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2610</th>\n",
       "      <td>20227</td>\n",
       "      <td>巽寮湾</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.3</td>\n",
       "      <td>海天相接，远山淡云，浑然一体</td>\n",
       "      <td>114.762006,22.69323</td>\n",
       "      <td>广东·惠州·惠东县</td>\n",
       "      <td>22</td>\n",
       "      <td>18</td>\n",
       "      <td>35.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>惠州</td>\n",
       "      <td>惠东县</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2705</th>\n",
       "      <td>20322</td>\n",
       "      <td>桂山风景区</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.1</td>\n",
       "      <td>素有植物王国、动物乐园、旅游天堂之称</td>\n",
       "      <td>114.602153,23.728553</td>\n",
       "      <td>广东·河源·源城区</td>\n",
       "      <td>1</td>\n",
       "      <td>8</td>\n",
       "      <td>37.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>河源</td>\n",
       "      <td>源城区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2586</th>\n",
       "      <td>20203</td>\n",
       "      <td>韶关丹霞山</td>\n",
       "      <td>5A</td>\n",
       "      <td>5.0</td>\n",
       "      <td>丹霞地貌命名地</td>\n",
       "      <td>113.745153,25.0304</td>\n",
       "      <td>广东·韶关·浈江区</td>\n",
       "      <td>7</td>\n",
       "      <td>252</td>\n",
       "      <td>39.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>韶关</td>\n",
       "      <td>浈江区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2755</th>\n",
       "      <td>20372</td>\n",
       "      <td>野趣沟</td>\n",
       "      <td>无</td>\n",
       "      <td>4.4</td>\n",
       "      <td>以野性之谜解读生态文化</td>\n",
       "      <td>114.630991,23.715075</td>\n",
       "      <td>广东·河源·源城区</td>\n",
       "      <td>1</td>\n",
       "      <td>18</td>\n",
       "      <td>44.5</td>\n",
       "      <td>广东</td>\n",
       "      <td>河源</td>\n",
       "      <td>源城区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2634</th>\n",
       "      <td>20251</td>\n",
       "      <td>地王大厦</td>\n",
       "      <td>3A</td>\n",
       "      <td>4.7</td>\n",
       "      <td>南望香港，北瞰深圳</td>\n",
       "      <td>114.117184,22.548871</td>\n",
       "      <td>广东·深圳·罗湖区</td>\n",
       "      <td>0</td>\n",
       "      <td>64</td>\n",
       "      <td>49.9</td>\n",
       "      <td>广东</td>\n",
       "      <td>深圳</td>\n",
       "      <td>罗湖区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2710</th>\n",
       "      <td>20327</td>\n",
       "      <td>开平碉楼</td>\n",
       "      <td>无</td>\n",
       "      <td>4.9</td>\n",
       "      <td>中国华侨文化的纪念丰碑</td>\n",
       "      <td>112.586516,22.376606</td>\n",
       "      <td>广东·江门·开平市</td>\n",
       "      <td>12</td>\n",
       "      <td>32</td>\n",
       "      <td>50.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>江门</td>\n",
       "      <td>开平市</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2682</th>\n",
       "      <td>20299</td>\n",
       "      <td>星湖旅游景区</td>\n",
       "      <td>5A</td>\n",
       "      <td>5.0</td>\n",
       "      <td>群山环绕，湖水碧绿</td>\n",
       "      <td>112.463855,23.072985</td>\n",
       "      <td>广东·肇庆·端州区</td>\n",
       "      <td>3</td>\n",
       "      <td>22</td>\n",
       "      <td>56.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>肇庆</td>\n",
       "      <td>端州区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2625</th>\n",
       "      <td>20242</td>\n",
       "      <td>鼎湖山</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.3</td>\n",
       "      <td>风光秀丽，具有浓郁江南诗情画意</td>\n",
       "      <td>112.561202,23.165899</td>\n",
       "      <td>广东·肇庆·星湖旅游景区</td>\n",
       "      <td>2</td>\n",
       "      <td>110</td>\n",
       "      <td>64.5</td>\n",
       "      <td>广东</td>\n",
       "      <td>肇庆</td>\n",
       "      <td>星湖旅游景区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2648</th>\n",
       "      <td>20265</td>\n",
       "      <td>广东第一峰</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.2</td>\n",
       "      <td>是北回归线上极大的一片绿洲</td>\n",
       "      <td>112.878516,24.819554</td>\n",
       "      <td>广东·清远·阳山县</td>\n",
       "      <td>3</td>\n",
       "      <td>92</td>\n",
       "      <td>69.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>清远</td>\n",
       "      <td>阳山县</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2743</th>\n",
       "      <td>20360</td>\n",
       "      <td>帝都温泉</td>\n",
       "      <td>无</td>\n",
       "      <td>4.0</td>\n",
       "      <td>园林式温泉，休闲疗养好去处</td>\n",
       "      <td>112.30938,22.294636</td>\n",
       "      <td>广东·江门·恩平市</td>\n",
       "      <td>1</td>\n",
       "      <td>26</td>\n",
       "      <td>70.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>江门</td>\n",
       "      <td>恩平市</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2680</th>\n",
       "      <td>20297</td>\n",
       "      <td>万绿湖</td>\n",
       "      <td>4A</td>\n",
       "      <td>5.0</td>\n",
       "      <td>处处是绿，四季皆绿</td>\n",
       "      <td>114.638453,23.780735</td>\n",
       "      <td>广东·河源·东源县</td>\n",
       "      <td>5</td>\n",
       "      <td>20</td>\n",
       "      <td>96.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>河源</td>\n",
       "      <td>东源县</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2622</th>\n",
       "      <td>20239</td>\n",
       "      <td>闸坡大角湾</td>\n",
       "      <td>5A</td>\n",
       "      <td>4.5</td>\n",
       "      <td>阳光灿烂，沙质均匀松软，海水清澈纯净</td>\n",
       "      <td>111.85393,21.576301</td>\n",
       "      <td>广东·阳江·江城区</td>\n",
       "      <td>0</td>\n",
       "      <td>20</td>\n",
       "      <td>109.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>阳江</td>\n",
       "      <td>江城区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2628</th>\n",
       "      <td>20245</td>\n",
       "      <td>海陵岛</td>\n",
       "      <td>4A</td>\n",
       "      <td>5.0</td>\n",
       "      <td>四面环海，水碧沙净，四季分明，气候宜人</td>\n",
       "      <td>111.892632,21.623062</td>\n",
       "      <td>广东·阳江·江城区</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>109.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>阳江</td>\n",
       "      <td>江城区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2782</th>\n",
       "      <td>20399</td>\n",
       "      <td>上川岛</td>\n",
       "      <td>无</td>\n",
       "      <td>4.2</td>\n",
       "      <td>有“南海碧波出芙蓉”之称</td>\n",
       "      <td>112.821579,21.742728</td>\n",
       "      <td>广东·江门·川山群岛旅游度假区</td>\n",
       "      <td>0</td>\n",
       "      <td>70</td>\n",
       "      <td>140.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>江门</td>\n",
       "      <td>川山群岛旅游度假区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2604</th>\n",
       "      <td>20221</td>\n",
       "      <td>下川岛</td>\n",
       "      <td>无</td>\n",
       "      <td>4.4</td>\n",
       "      <td>逃离尘都，一起去看海</td>\n",
       "      <td>112.600071,21.637676</td>\n",
       "      <td>广东·江门·川山群岛旅游度假区</td>\n",
       "      <td>2</td>\n",
       "      <td>192</td>\n",
       "      <td>157.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>江门</td>\n",
       "      <td>川山群岛旅游度假区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2665</th>\n",
       "      <td>20282</td>\n",
       "      <td>茂名潜梦岛海洋王国（原放鸡岛）</td>\n",
       "      <td>4A</td>\n",
       "      <td>4.2</td>\n",
       "      <td>石奇、礁美、滩佳、鱼丰、林绿、鸟多</td>\n",
       "      <td>111.193013,21.384367</td>\n",
       "      <td>广东·茂名·电白县</td>\n",
       "      <td>0</td>\n",
       "      <td>42</td>\n",
       "      <td>165.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>茂名</td>\n",
       "      <td>电白县</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4933</th>\n",
       "      <td>43897</td>\n",
       "      <td>澳门环岛游</td>\n",
       "      <td>无</td>\n",
       "      <td>4.0</td>\n",
       "      <td>“浪漫之城”珠海的美丽景色一览无余</td>\n",
       "      <td>113.540119,22.196822</td>\n",
       "      <td>广东·珠海·金湾区</td>\n",
       "      <td>0</td>\n",
       "      <td>77</td>\n",
       "      <td>168.0</td>\n",
       "      <td>广东</td>\n",
       "      <td>珠海</td>\n",
       "      <td>金湾区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2576</th>\n",
       "      <td>20193</td>\n",
       "      <td>深圳欢乐谷</td>\n",
       "      <td>5A</td>\n",
       "      <td>4.0</td>\n",
       "      <td>狂欢无罪，够胆你就来</td>\n",
       "      <td>113.987249,22.547732</td>\n",
       "      <td>广东·深圳·南山区</td>\n",
       "      <td>21</td>\n",
       "      <td>1128</td>\n",
       "      <td>219.8</td>\n",
       "      <td>广东</td>\n",
       "      <td>深圳</td>\n",
       "      <td>南山区</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      index             景点名称  星级   评分                   介绍  \\\n",
       "2624  20241             圆明新园  4A  4.7           原尺寸仿建北京圆明园   \n",
       "2677  20294              淡浮院  4A  4.1       坐东面西，依山傍水，风景绝佳   \n",
       "2610  20227              巽寮湾  4A  4.3       海天相接，远山淡云，浑然一体   \n",
       "2705  20322            桂山风景区  4A  4.1   素有植物王国、动物乐园、旅游天堂之称   \n",
       "2586  20203            韶关丹霞山  5A  5.0              丹霞地貌命名地   \n",
       "2755  20372              野趣沟   无  4.4          以野性之谜解读生态文化   \n",
       "2634  20251             地王大厦  3A  4.7            南望香港，北瞰深圳   \n",
       "2710  20327             开平碉楼   无  4.9          中国华侨文化的纪念丰碑   \n",
       "2682  20299           星湖旅游景区  5A  5.0            群山环绕，湖水碧绿   \n",
       "2625  20242              鼎湖山  4A  4.3      风光秀丽，具有浓郁江南诗情画意   \n",
       "2648  20265            广东第一峰  4A  4.2        是北回归线上极大的一片绿洲   \n",
       "2743  20360             帝都温泉   无  4.0        园林式温泉，休闲疗养好去处   \n",
       "2680  20297              万绿湖  4A  5.0            处处是绿，四季皆绿   \n",
       "2622  20239            闸坡大角湾  5A  4.5   阳光灿烂，沙质均匀松软，海水清澈纯净   \n",
       "2628  20245              海陵岛  4A  5.0  四面环海，水碧沙净，四季分明，气候宜人   \n",
       "2782  20399              上川岛   无  4.2         有“南海碧波出芙蓉”之称   \n",
       "2604  20221              下川岛   无  4.4           逃离尘都，一起去看海   \n",
       "2665  20282  茂名潜梦岛海洋王国（原放鸡岛）  4A  4.2    石奇、礁美、滩佳、鱼丰、林绿、鸟多   \n",
       "4933  43897            澳门环岛游   无  4.0    “浪漫之城”珠海的美丽景色一览无余   \n",
       "2576  20193            深圳欢乐谷  5A  4.0           狂欢无罪，够胆你就来   \n",
       "\n",
       "                       经纬度             所在地区  儿童旅客量   销售量     门票   省   市  \\\n",
       "2624  113.544454,22.246264        广东·珠海·香洲区     11     4    0.5  广东  珠海   \n",
       "2677  116.706533,23.683279        广东·潮州·湘桥区      0    46   30.0  广东  潮州   \n",
       "2610   114.762006,22.69323        广东·惠州·惠东县     22    18   35.0  广东  惠州   \n",
       "2705  114.602153,23.728553        广东·河源·源城区      1     8   37.0  广东  河源   \n",
       "2586    113.745153,25.0304        广东·韶关·浈江区      7   252   39.0  广东  韶关   \n",
       "2755  114.630991,23.715075        广东·河源·源城区      1    18   44.5  广东  河源   \n",
       "2634  114.117184,22.548871        广东·深圳·罗湖区      0    64   49.9  广东  深圳   \n",
       "2710  112.586516,22.376606        广东·江门·开平市     12    32   50.0  广东  江门   \n",
       "2682  112.463855,23.072985        广东·肇庆·端州区      3    22   56.0  广东  肇庆   \n",
       "2625  112.561202,23.165899     广东·肇庆·星湖旅游景区      2   110   64.5  广东  肇庆   \n",
       "2648  112.878516,24.819554        广东·清远·阳山县      3    92   69.0  广东  清远   \n",
       "2743   112.30938,22.294636        广东·江门·恩平市      1    26   70.0  广东  江门   \n",
       "2680  114.638453,23.780735        广东·河源·东源县      5    20   96.0  广东  河源   \n",
       "2622   111.85393,21.576301        广东·阳江·江城区      0    20  109.0  广东  阳江   \n",
       "2628  111.892632,21.623062        广东·阳江·江城区      1     4  109.0  广东  阳江   \n",
       "2782  112.821579,21.742728  广东·江门·川山群岛旅游度假区      0    70  140.0  广东  江门   \n",
       "2604  112.600071,21.637676  广东·江门·川山群岛旅游度假区      2   192  157.0  广东  江门   \n",
       "2665  111.193013,21.384367        广东·茂名·电白县      0    42  165.0  广东  茂名   \n",
       "4933  113.540119,22.196822        广东·珠海·金湾区      0    77  168.0  广东  珠海   \n",
       "2576  113.987249,22.547732        广东·深圳·南山区     21  1128  219.8  广东  深圳   \n",
       "\n",
       "              区  \n",
       "2624        香洲区  \n",
       "2677        湘桥区  \n",
       "2610        惠东县  \n",
       "2705        源城区  \n",
       "2586        浈江区  \n",
       "2755        源城区  \n",
       "2634        罗湖区  \n",
       "2710        开平市  \n",
       "2682        端州区  \n",
       "2625     星湖旅游景区  \n",
       "2648        阳山县  \n",
       "2743        恩平市  \n",
       "2680        东源县  \n",
       "2622        江城区  \n",
       "2628        江城区  \n",
       "2782  川山群岛旅游度假区  \n",
       "2604  川山群岛旅游度假区  \n",
       "2665        电白县  \n",
       "4933        金湾区  \n",
       "2576        南山区  "
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广东_门票_ascending = df_new[df_new.省.str.contains('广东')].sort_values('门票',ascending=True)\n",
    "广东_门票_ascending[广东_门票_ascending[\"评分\"]>=4]\n",
    "# 广东_门票_ascending"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "359px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
